aspose file tools*
The moose likes Java in General and the fly likes All abstract methods Vs interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "All abstract methods Vs interface" Watch "All abstract methods Vs interface" New topic
Author

All abstract methods Vs interface

Vikas
Ranch Hand

Joined: Dec 16, 2004
Posts: 63
Hi All,

This is really a beginners' question and my question is if an abstract class has all of its methods "abstract" in it(i.e. no concrete methods) then what will be the difference between this abstarct class and an interface.

Thank you
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
If all your methods are abstract you are better off writing an interface, because you can implement several interfaces in the same class, but only extend one class. Remember you usually miss out "public" and "abstract" in method declarations in interfaces.
 
Don't get me started about those stupid light bulbs.
 
subject: All abstract methods Vs interface