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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give me an example of array and linked list? Where they can be used?

766


Difference between Preemptive scheduling vs. Time slicing?

796


Can extern variables be initialized?

685


How many types of parsers are there?

786


Is arraylist ordered in java?

775


what is deadlock? : Java thread

740


What is difference between wait and notify in java?

799


What are keyboard events?

841


What do you understand by java?

756


Explain the difference between association, aggregation and inheritance relationships.

816


Is void a data type?

713


there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1775


What is the lifetime and scope of a variable?

756


What is the use of toarray () in java?

784


When would you use a static class?

762