This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java" Watch "Java" New topic
Author

Java

Sanam Chandrasekaran
Greenhorn

Joined: May 05, 2004
Posts: 17
Is multiple inheritance allowed in java,if not then what is implimentation of more than one interface.
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
No multiple inheritance is not allowed in java as in c++. Yes a class can implement more than one interfaces.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10925
    
  12

what is implimentation of more than one interface ?

Implementing an interface is not inheritance. Inheritance says "I want EVERYTHING this class has, then i'm going to add to it and change some of it. The sub-class, without doing anything other than saying "extends CLASS" is a fully functional class (without getting into abstract classes). You're saying "I want something that does everything class A does, except i need to change this one little bit.
Implementing an interface is doing nothing more than agreeing to a contract. An interface defines one or more methods that a class MUST, well, implement. When you type "implements INTERFACE", all you've done is signed the dotted line saying "I promise that somehow, my class will have these methods." Then you have to actually WRITE those methods to adhere to the contract.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java
 
Similar Threads
c++ or Java--your suggestions please
zipping as self extracting exe
class
J2EE
WA #2 ..... word association