Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract class and Interface  RSS feed

 
saravana kumar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a abstract class exist without abstract method ?
is it possible a interface class has empty body ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can have an abstract class with no abstract methods. Yes, you can have empty interfaces -- like java.lang.Cloneable and java.io.Serializable.
 
Phani Kumar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have interface without body and it has got a special name "Marker interface"
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!