Results 1 to 4 of 4

Thread: Various forms of inheritance in java

  1. #1
    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...

  2. #2
    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".

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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

Similar Threads

  1. how to use multiple inheritance in core java
    By Mewad in forum Software Development
    Replies: 4
    Last Post: 08-01-2011, 10:31 AM
  2. Problem with inheritance in java
    By Miles Runner in forum Software Development
    Replies: 5
    Last Post: 03-03-2010, 12:10 PM
  3. What does Inheritance mean in java?
    By Mithun Seth in forum Software Development
    Replies: 5
    Last Post: 08-02-2010, 11:45 AM
  4. Replies: 3
    Last Post: 19-11-2009, 09:24 AM
  5. Multiple Inheritance in Java
    By KALINDA in forum Software Development
    Replies: 3
    Last Post: 03-11-2009, 07:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,476,017.49816 seconds with 16 queries