Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Implementing Mutilple Inheritance in Java

 
webmaster forum
jaincool  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 15
September 11, 2008, 01:09:46 PM

As all us must be knowing that we cannot apply Multiple Inheritance in JAVA ,but according to the class diagram of my project i am required to implement the same .Can anyone of you please help me out but letting me know how do we apply Multiple inheritance in JAVA?
Its very crucial for my project.
So please Help me out friends.
 
webmaster forum
gamernz  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 15
September 11, 2008, 05:00:53 PM

I will try and find my lecture notes on multiple inheritance then I will try and answer your question. If I remember correctly, it is reasonably easy to implement and work with.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
September 12, 2008, 02:51:40 AM

The reason Java doesnt allow multiple inheritance is that there can be some ambiguity if not carefully designed. If C inherits from class A and B and both these classes implement method Q, then which method does C.Q call? Of course, some languages have solved this sucessfully.

Java supports solving problems, commonly designed for multiple inheritance, in other ways. Rather than typing a lengthy thing out here, have a look at this webpage http://pclc.pace.edu/~bergin/patterns/multipleinheritance.html - at a short scan it might be helpful to you.

A personal note on OO design. Inheritance is very statically determined - if A inherits from B which inherits from C this is difficult (impossible?) to modify at runtime [dynamically] elegantly.

Nick
« Last Edit: September 25, 2008, 08:07:32 AM by polas »

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
rajan  Offline
Activity
0%
 
Regular Coder
Gender: Male
Posts: 64
Topics: 20
November 20, 2008, 09:38:41 PM

Java does not support multiple inheritance But it a important concept in oop so java provides an alternate way of implementing concept
1. Design an interface
2. extent one interface by the other
3. inherit an interface
4. implement multiple inheritance using interfaces.

http://infos-tech.blogspot.com/
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
November 21, 2008, 04:42:06 AM

Yup, its quite a faf though isn't it!

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
vijay12  Offline
Activity
0%
 
Regular Coder
Posts: 67
Topics: 33
December 26, 2008, 11:03:07 PM

Yeah its really a interesting question. As we all know that we cant able to implement multiple inheritance in java but instead of that interface will help you to compensate multiple inheritance features.
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
January 02, 2009, 08:46:04 AM

Did they suceed though - is the Java approach better (or sufficient) over the multiple inheritance approach?

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
vijay12  Offline
Activity
0%
 
Regular Coder
Posts: 67
Topics: 33
January 03, 2009, 11:21:00 AM

hi  friend , according  to  me  the  multiple  inheritance  is implemented  in  JAVA  by using  an utility  class ....which allows  multiple inheritance to be simulated ...
 
webmaster forum
polas  Offline
Activity
33.33%
 
Code Guru
Gender: Male
Posts: 1399
Topics: 85
WWW
January 03, 2009, 02:46:15 PM

hi  friend , according  to  me  the  multiple  inheritance  is implemented  in  JAVA  by using  an utility  class ....which allows  multiple inheritance to be simulated ...

More information needed - theres a difference between simulating it and implementing it

Mesham Type Oriented Parallel Programming Language, Free online technical support
 
webmaster forum
Activity
0%
 
New Coder
Posts: 25
Topics: 2
April 26, 2011, 01:02:15 PM

As we all mate that we jargon competent to implement octuple inheritance in beverage but instead of that port will aid you to equilibrize bigeminal heritage features.

Karaoke Microphone | speed bag platform | tennis net
 
webmaster forum
Activity
0%
 
Skilled Coder
Posts: 125
Topics: 0
May 06, 2011, 01:13:31 AM

As per my knowledge JAVA doesn't support mulitple Inheritance. You can do the same thing with the help of utility class.

Network Management Service
 
webmaster forum
mak14317  Offline
Activity
0%
 
Skilled Coder
Real name: Janne
Location: california
Gender: Male
Age: 26
Posts: 108
Topics: 1
WWW
May 06, 2011, 03:29:17 AM

Java does not support multiple implementation inheritance, but does support multiple interface inheritance. When you read or overhear someone remark that Java does not support multiple inheritance, what is actually meant is that it does not support multiple implementation inheritance.

herbal vaporizer
Happy vappy vaporizer
Eclipse Vape
Ivape
 
webmaster forum
Activity
0%
 
Regular Coder
Gender: Male
Age: 24
Posts: 60
Topics: 10
July 10, 2011, 11:10:32 PM

multiple inheritance is not supported by java, to use multiple inheritance you have to used the concept of Interface then its possible to use as like multiple inheritance.
Interface contains declaration of methods we have to write definition of it in child class.

Payday loan
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 05, 2012, 01:02:39 AM