| | |
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 |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows






