File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes What's the differnce betwwen abstract class and interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What Watch "What New topic

What's the differnce betwwen abstract class and interface

Tan Richards

Joined: Sep 29, 2005
Posts: 18
actually I would like to know under what circumstances one should go for abstract class and interface? It's understood when multiple inheritence is required interface must be used. But are ther any other factors that will decide that whether one should make a particular class abstract or use interface. It is being assumed that the class is used for just creating a prototype( I mean the sole purpose of using abstract methods).

"Failures are pillars of success" - That doesn't mean you go on building pillars
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Aadi Narayana Reddy

Joined: Oct 17, 2005
Posts: 13
When u have some default functionality to be placed some where so that the all the subclasses can use the default functionality from its super classes, and they can provide some more info,, in the subclass.

and when u r required to build subclasses which must have their specific behaviour then u can go for interface and implement it with respect to the specific subclass.


G.Adi Narayana Reddy,
I agree. Here's the link:
subject: What's the differnce betwwen abstract class and interface
It's not a secret anymore!