Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9233461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:33:32+00:00 2026-06-18T06:33:32+00:00

It is said, that Java language support single inheritance only. However how is it

  • 0

It is said, that Java language support single inheritance only.
However how is it possible to inherit from Object and from any other class at the same time? Isn’t that a multiple inheritance.

Secondly, what for do we need to inherit all 11 Object methods? I could hardly imagine why do I need it them in I/O e.g.

Finally JDK 8 is going to offer us default methods realization in interfaces and if which would probably cause multiple inheritance in Java.

What if interface A provides method a() with default realization and interface B provides also a() method with another default realization and our custom class C implements both interfaces and rely on default realization – wouldn’t that be Diamond of Death ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:33:34+00:00Added an answer on June 18, 2026 at 6:33 am

    However how is it possible to inherit from Object and from any other
    class at the same time? Isn’t that a multiple inheritance.

    No this is not what happens. Not all classes directly extend from Object class. But only the class at the top level of inheritance hierarchy extends from Object class(implicitly). Rest of the classes lower in the hierarchy, extends from the Object class through the super classes. And, this is what we call multi-level inheritance.

    So, consider the below hierarchy: –

    class A { }
    
    class B extends A { }
    

    In the above case, class A is equivalent to class A extends Object.

    Secondly, what for do we need to inherit all 11 Object methods? I
    could hardly imagine why do I need it them in I/O

    I suspect you meant override when you say inherit. You don’t need to override any method of Object class. It’s just on your requirement, whether to override any method or not. For e.g.: – You would often want to override equals() method, so as to write custom equality test for your instances. And in that case, you should also override the hashCode() method, to maintain the contract of equals() and hashCode().

    Finally JDK 8 is going to offer us default methods realization in
    interfaces and if which would probably cause multiple inheritance in
    Java.

    What if interface A provides method a() with default realization and
    interface B provides also a() method with another default realization
    and our custom class C implements both interfaces and rely on default
    realization – wouldn’t that be Diamond of Death ?

    I can’t comment on this concept, because I haven’t read about this thing yet. Probably, I would update the answer sometime later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading about threads and in many books is said that Java support threads
It is said that static blocks in java run only once when that class
I have heard it said that Objective-C is a 'simple' language, i.e. in terms
I'm calling a Java method from another language ( R ). Some of the
I've read the Java trail oracle provides and they said that the objects properties
In many books is said that the reason for which Java's generic use erasure
I'm beginning to program in Java. public static void main(String[]args) A book said that
My Java teacher (High school course) was talking about loops and she said that
Somebody said that when your PHP code and application use global variables then it
It is said that When an interrupt is sent by the PIC, the PIC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.