• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

inheritence

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.
 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karthika

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 ]
 
karthika gkumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hidear
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 ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!