Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 20-11-2009
Member
 
Join Date: Jan 2009
Posts: 45
Various forms of inheritance in java

Hi friends,

I am doing the java programming course. I am totally confused regarding various forms of inheritance in java.I have read lots of books, but still confused.

I have trouble in understanding various inheritance of java.It is very difficult to find out the difference among them.

Please help me to understand the various forms of inheritance...
Reply With Quote
  #2  
Old 20-11-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Various forms of inheritance in java

As per my java knowledge, Java supports only three forms of inheritance as below:

1. single level inheritance :
In this type of inheritance "class B extends Class A"

2. Multilevel inheritance:
In this type of inheritance "class C extends class B and class B extends class A"

3. multiple inheritance:
In this type of inheritance "Class C inherits features of Class A as well as features of Class B".
Reply With Quote
  #3  
Old 20-11-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Various forms of inheritance in java

There are only two forms of inheritance in the Java programming language.

i). The standard inheritance form is by extension; a class declares that it extends features of the another class, OR an interface which extends another interface. In this case, the child class or child interface inherits all the features of its parent.

ii). The another form of inheritance is where classes declare that they implement an interface. When a class implements an interface, it can inherits any fields from the base as final constants, but it must provide its own implementation for the interface methods.
Reply With Quote
  #4  
Old 20-11-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Various forms of inheritance in java

Java supports only two type of inheritance i.e Single level and multilevel inheritance. Java doesn't supports Multiple inheritance.
The reasons for exclusion of multiple inheritance from the Java mostly originated from the object oriented, simple and familiar goal. As a simple language, creators of java wanted a language in which most developers could grasp without any extensive training. According to designers' opinion, multiple inheritance can causes more problems as well as confusion than it solves. So they cut multiple inheritance concept from the java language
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Various forms of inheritance in java"
Thread Thread Starter Forum Replies Last Post
how to use multiple inheritance in core java Mewad Software Development 4 08-01-2011 10:31 AM
Problem with inheritance in java Miles Runner Software Development 5 03-03-2010 12:10 PM
What does Inheritance mean in java? Mithun Seth Software Development 5 08-02-2010 11:45 AM
Actual use of interface in java other than multiple inheritance Saaz Software Development 3 19-11-2009 09:24 AM
Multiple Inheritance in Java KALINDA Software Development 3 03-11-2009 07:43 PM


All times are GMT +5.5. The time now is 11:19 AM.