Results 1 to 3 of 3
  1. #1
    pawanspace is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Default multiple inheritance in java

    Hi All,
    I have read in books and also every where that each class in java is subclass of java.lang.Object. Then how it's able to extend any other class. becuase what I know that multiple inheritance is not allowed in java

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    It is done implicitly. That means you still have one more chance to do it explicitly :)

  3. #3
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    An example of multiple inheritance is
    Java Code:
    public class Test extends Foo, Bar // illegal! 
    {...}
    Further, implicitly means that the compiler makes the extension for you, in this case.

    So technically, it would look like this
    Java Code:
    public class Foo extends Object 
    {...}
    
    public class Bar extends Foo 
    {...}

Similar Threads

  1. Inheritance
    By mew in forum New To Java
    Replies: 1
    Last Post: 12-07-2007, 06:08 PM
  2. Multiple Inheritance
    By mew in forum New To Java
    Replies: 1
    Last Post: 12-01-2007, 10:04 PM
  3. help with inheritance in hibernate
    By valery in forum JDBC
    Replies: 1
    Last Post: 08-06-2007, 08:44 PM
  4. Multiple Inheritance in java
    By paty in forum New To Java
    Replies: 4
    Last Post: 08-02-2007, 02:25 PM
  5. Inheritance in GUI
    By Marty in forum SWT / JFace
    Replies: 2
    Last Post: 05-11-2007, 12:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •