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 what is the difference between Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is the difference between " Watch "what is the difference between " New topic
Author

what is the difference between

Nikos kat
Greenhorn

Joined: Jan 20, 2006
Posts: 20
what is the difference between an abstract class and an interface?
Craig Tyler
Ranch Hand

Joined: Jan 15, 2006
Posts: 52
Interfaces let you get by the multiple inheritance problem by forcing you to implement all of its methods in a class that implements it. Abstract classes can have defined methods and fields that aren't necessarily public, static, and final.
Nikos kat
Greenhorn

Joined: Jan 20, 2006
Posts: 20
thanks for your help
badri nath
Ranch Hand

Joined: Dec 21, 2005
Posts: 57
Hi Nikos
Abstract class can have abstract methods as well as concrete methods whereas an interface will have only abstract methods.In one way we can call an interface as a pure abstract class.
We can create constructors for abstract classes whereas that is not possible for an interface.
mert �zkaya
Ranch Hand

Joined: Jan 26, 2006
Posts: 33
Hi everyone,
Can we create an instance of any bastract class??

Thanks,

Mert
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Nope, it's pretty much the definition of "abstract class" that you can't instantiate one. Somebody has to extend it into a concrete class that you can instantiate. Often an abstract class is "incomplete" ... you see this in methods marked "abstract" that somebody must implement to make a concrete class.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what is the difference between
 
It's not a secret anymore!