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
Difference between overriding and overloading in java?
What are data types in oop?
How can you add and remove nodes in jtree?
What is array and arraylist in java?
What is the difference between the size and capacity of a vector?
When we should use serialization?
What is a "pure virtual" member function?
What are facelets templates?
What is the use of coding?
Write a program to print 15 random numbers using foreach of java 8?
Which non-unicode letter characters may be used as the first character of an identifier?
Is java pass by value or pass by reference?
What is the function of compareto in java?
What is the difference between Error, defect,fault, failure and mistake?
Can I declare class as static or private?