jQuery in Action, 2nd edition*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 38472
    
  23
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: All abstract methods Vs interface