aspose file tools*
The moose likes Beginning Java and the fly likes Interface And abstract 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 » Beginning Java
Bookmark "Interface And abstract" Watch "Interface And abstract" New topic
Author

Interface And abstract

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
Hello!

When we have abstract,Why do we ue interface?

By abstract we have variable,But in interface we have not(other than variable that has constant value)

What is difference of the abstract usage and interface usage?
When do we need to interface?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

See Interface vs. Abstract Class (linked to from our Beginners FAQ).


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11240
    
  16

hint - how many classes can you extend from?

how many interfaces can you implement?

This is not the only, definitive answer, but it's a pretty good one.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I've wondered about that FAQ. Is this statement: Actually the first point is the reason for the existence of interfaces in Java: to provide a form of multiple inheritance. supported in Sun literature?


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
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38398
    
  23
Stan, in the original white paper about the Java language, look at �2.2.5 about multiple inheritance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface And abstract