File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Abstract Classes & Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Abstract Classes & Interfaces" Watch "Abstract Classes & Interfaces" New topic
Author

Abstract Classes & Interfaces

Prem Chand
Greenhorn

Joined: Nov 13, 2002
Posts: 3
What is the difference b/w abstract classes and Interfaces?
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
This sounds more like it belongs in the beginner's forum. I will move it there for you.


Matthew Phillips
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
The basic difference is that with an abstract class you can define implemented methods along with abstract methods. With an interface you can only define abstract methods, although you don't need to use the abstract keyword.
Another key difference is that a class can only inherit from one other class. It can implement multiple interfaces. Use interfaces if you need that type of behavior.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
I'd suggest that you try a quick search on each of the three Java in General forums and the OO forum for this topic as it has been discussed here a few times already.
Note that the search page link is at the top right of this page.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
 
subject: Abstract Classes & Interfaces
 
Similar Threads
Abstarct Interface
Abstract classes and Interfaces
interfaces and abstract class
Difference Between Abstract Class and Interface
Doubt