Answer Posted / debapriya patra
Java does not support multiple inheritance.Why?
If anybody ask u why java does not support multiple
inveritance then answer is:"Whenever we create an instance
of a child class and we extend more then one class like
C++, then if these two classes contain same variable then
which will print if we try to print the variable."
Example:
class a
{
int i = 10;
}
class b
{
int i = 10;
}
class c extends a,b
{
public static void main(String[] args)
{
c c1 = new c();
System.out.printn(c1.i);//Here an ambiguous situation
will occur
}
}
| Is This Answer Correct ? | 29 Yes | 14 No |
Post New Answer View All Answers
Tell me are there implementations for sorting and searching in the java libarary?
Are maps ordered java?
What is overriding in java?
Why lambda expression is used in java?
Which is better stringbuilder or stringbuffer?
Explain different forms of polymorphism?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
What is identifier with example?
How will you initialize an Applet?
What do you understand by the term polymorphism?
Is java an open source?
Is java a virus?
Which keyword specify that a variable is effectively final ?
What is the base class of all exception classes?
How do you identify independent and dependent variables?