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
Which are the two subclasses under exception class?
How do I type unicode?
What does the three dot emoji mean?
How to find the given number is a prime number or not by getting input from the user
why an outer class cannot be declared as private?
What is java util concurrentmodificationexception?
What is the size of an array?
What state does a thread enter when it terminates its processing in java programming?
Which graphs are functions?
What are peerless components?
What is maximum size of arraylist in java?
What's the access scope of protected access specifier?
Is final static java?
Which class contains a method: cloneable or object?
Is java still relevant?