| | |
Inheritance
![]() |
•
•
Join Date: Dec 2008
Posts: 3
Reputation:
Solved Threads: 0
Hello,
Please tell me in Java we don't have a multiple inheritance? so,in which function we use these inheritance.
Thanks
Please tell me in Java we don't have a multiple inheritance? so,in which function we use these inheritance.
Thanks
•
•
•
•
Hello,
Please tell me in Java we don't have a multiple inheritance? so,in which function we use these inheritance.
Thanks
> we don't have a multiple inheritance
but then you ask:>in which function we use these inheritance
The only thing I can say is that java doesn't have multiple class inheritance, but multiple Interface implementation.
If that doesn't cover you, ask a better question
Check out my New Bike at my Public Profile at the "About Me" tab
That's what javaAddict said, Java does not have multiple class inheritance, you can only only extend (is-A) one class. However you can implement (has-A) any amount of interfaces you want.
Last edited by jasimp; Dec 31st, 2008 at 7:41 pm.
"Argyou not with the hand you are dealt in cards or life." ---- Wizard and Glass
•
•
•
•
That's what javaAddict said, Java does not have multiple class inheritance, you can only only extend (is-A) one class. However you can implement (has-A) any amount of interfaces you want.
what jasimp said is correct expect that implementing a interface is *NOT* mean "Has-A" relationship.
Has-A relationship is what when an Class has other Class's object in it's attribute
Implementing a interface is also means "Is-A" relationship
e.g
Java Syntax (Toggle Plain Text)
//for Is-A class Mammal { } class Dog extends Mammal { } //for Has-A class Tail { } class Dog extends Mammal { // Dog IS-A mammal Tail tail ; // and Has-A Tail }
The important thing is not to stop questioning. Curiosity has its own reason for existing.
-Albert Einstein
-Albert Einstein
![]() |
Similar Threads
- need idea for project using classes and inheritance (C++)
- Inheritance (C++)
- Need example of how to use INHERITANCE! (C++)
- C++ BASICS ==> Pointers, Call by Reference/Value, Inheritance, Functions & Arrays (C++)
- Inheritance & Derived Classes (C++)
Other Threads in the Java Forum
- Previous Thread: webcam application startup
- Next Thread: Sending ByteBuffer on TCP and UDP Connection
| Thread Tools | Search this Thread |
-xlint actionlistener android api applet application array automation bi binary blackberry block bluetooth character class client code compile compiler component consumer database desktop developmenthelp eclipse error fractal freeze ftp functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int j2me j2seprojects java javac javaee javaprojects jetbrains jni jpanel jtable julia learningresources lego linked linux mac main map method mobile myregfun netbeans nonstatic notdisplaying number online pearl printf problem program project qt researchinmotion rotatetext rsa scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






