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
What is the difference between numeric and integer?
How is java hashmap implemented?
Can keyword be used as identifier?
How do you break a loop?
What are the differences between stringbuffer and stringbuilder?
Why is java called the platform independent programming language?
What do you mean by inner class in java? Explain
What is java english?
Are arrays dynamic in java?
What is unicode full form?
What is a container in a gui?
What are the two types of streams offered by java 8?
How do you declare a destructor in java?
What does next mean in java?
Where will it be used?