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
How much is a java license?
How do listeners work?
What does it mean that a method or field is “static”?
Write a program in java to create a doubly linked list containing n nodes.
What is difference between core java and java ee?
What is multi-catch block in java?
What is a local class in java?
What do you know about the garbage collector?
How can we create an immutable class in java?
What are the different types of data structures in java?
What is classpath?
How is a variable stored in memory?
How to implement an arraylist in java?
What programs use java?
Are variables stored in ram?