Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


all are saying java doesn't support multiple inheritance but
by default Object class is super class for all the user
defined classes and we can extend atmost one class so each
class can extend more than one class so java supports
multiple inheritance?i am confused with this,pls any one
explain me.

Answers were Sorted based on User's Feedback



all are saying java doesn't support multiple inheritance but by default Object class is super ..

Answer / amit singh

logic is simple differnet
imagine you create a class
Class A
{
A()
{
super()
}
}
ya this class extends Object class implicitly
and it will definitely call the Object class constructor

but if you extends the Class A explicitly
then what will happen

class A0
{
AO()
{
super();
}
}
class A extends AO
{
A()
{
super();
}
}
}

so what happen because the Object class Replace by this
immediate super class which is in your Apis which you build
in your project

now the class AO is responsible to implicit extends Object
class
so what is the mean that Object inheritence is passeddown
through your Immediate super class
so don't say that implicit inheritence creete the mulitiple
inherritence
"because in java is not allowed beacaus so ambiguity
when one class extends Two classes and both have same method
signature
then which method will call
Amit singh
amitsing2008@gmail.com
amit09mca

Is This Answer Correct ?    13 Yes 0 No

all are saying java doesn't support multiple inheritance but by default Object class is super ..

Answer / manikandansit

Hello Mr.Kartik Naidhruva.I m not asking this is foolish or
not.i jus asking to explain.even though the question is
foolish don't answer like fool.jus explain how my question
is wrong that's better.jus explain about Object class

Is This Answer Correct ?    4 Yes 0 No

all are saying java doesn't support multiple inheritance but by default Object class is super ..

Answer / biswajit singh

I completely agree with Amit Singh. Excellent example.

Is This Answer Correct ?    2 Yes 0 No

all are saying java doesn't support multiple inheritance but by default Object class is super ..

Answer / kartik naidhruva

Its foolish to say a class extends more than one class...
Who told u that!!!!
inorder to implement multiple inheritance in java we use
INTERFACES....
with the help of interfaces we can Partially implement
Multiple inheritance

Is This Answer Correct ?    2 Yes 6 No

Post New Answer

More Core Java Interview Questions

What is synchronization and why is it important in java programming?

0 Answers  


How to find the length and capacity of a string buffer ?

2 Answers  


What is an iterator java?

0 Answers  


Can static methods be overridden?

5 Answers   Bravura Solutions,


Can we make a constructor final?

0 Answers  


Can we override the main method?

4 Answers  


What is the difference between C++ & Java?

78 Answers   College School Exams Tests, HAL, SUN, Syntel, TCS, Wipro,


what is use of marker interface? give me good example?

2 Answers  


What technique is carried out to find out if a particular string is empty?

0 Answers  


How many bytes is a char in java?

0 Answers  


What is classes in java?

0 Answers  


can two class in a code be public??if yes then how??

2 Answers  


Categories