Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes inheritence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "inheritence" Watch "inheritence" New topic


karthika gkumar

Joined: Apr 15, 2008
Posts: 6
in java all the classes are extend with Object class implicitly.
java does not support multiple inheritence.
but when we are extending a class with some other class doesnt that mean that class is extended twice?
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


Welcome to JavaRanch!

Multiple inheritance specifically means inheriting from several classes directly. A class can have only one direct parent class. The fact that the parent has its own parent doesn't matter.

[Jess in Action][AskingGoodQuestions]
abhishek pendkay
Ranch Hand

Joined: Jan 01, 2007
Posts: 184
in java all the classes are extend with Object class implicitly.

the correct statement would be
in java all classes that do not extend from any other class extend from the Object class so if your class in extending from some other class it will not directly extend from Object... so there is no multiple inheritance problem..
[ April 18, 2008: Message edited by: abhishek pendkay ]

The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
karthika gkumar

Joined: Apr 15, 2008
Posts: 6
thank you
Kuldeep Singh

Joined: Apr 20, 2008
Posts: 3
I would like to add some more.
it is called maultilevel inheritence which you are explnig exctly.
when we say multiple that means extends morethen oneclass. as you may see in C plus plus.
if we extend two class to one single class by extending 2-times then it is not not fair.
[ April 21, 2008: Message edited by: Kuldeep withDreams ]

Regards,<br />kuldeep<br /> <br />May be.!! Alot of People are responsible for your Success but you are the ONE responsible for your FAILURE.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: inheritence
It's not a secret anymore!