| | |
Inheritance
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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
Views: 501 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for Java
911 addressbook android api append apple applet application arguments array arrays automation binary bluetooth character chat class classes client code component csv database draw eclipse error event exception file fractal ftp game givemetehcodez graphics gui helpwithhomework html ide image input integer j2me japplet java javaarraylist javaprojects jmf jni jpanel julia linked linux list loop map method methods mobile netbeans newbie number object objects oracle oriented panel print printf problem program programming project projects recursion replaydirector reporting researchinmotion return robot rotatetext scanner screen se server set size sms socket sort sql stream string swing test threads time transfer tree ubuntu windows






