This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is the difference between