• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Java Inheritance Doubt

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

In java

every class basically extends Object class.

When ever we are extending our class from another class.

Totally our class extends a parent class and an Object class

But we dont have multiple inheritance.

How it happen?


Thanks & Regards

Areshbabu
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Totally our class extends a parent class and an Object class


No. All classes extend exactly one other class - either explicitly through an "extends" statement, or -if there is no such statement- implicitly Object is extended. It is not correct to say that both Object and a parent class are extended.
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

aresh babu wrote:Hello,

In java

every class basically extends Object class.

When ever we are extending our class from another class.

Totally our class extends a parent class and an Object class

But we dont have multiple inheritance.

How it happen?


Thanks & Regards

Areshbabu



No. Object class is extended indirectly through its superclass.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic