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 does math floor () do?
Why heap memory is called heap?
What is type inference in java8?
how to create multithreaded program? Explain different ways of using thread? : Java thread
Difference between collection, collection and collections in java?
Mention a package that is used for linked list class in java.
What is complexity in java?
what is nested class in java?
Can we extend singleton class in java?
When is the finalize() called?
What is the default access specifier for variables and methods of a class?
Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.
Can we initialize the final blank variable?
Is singleton thread safe in java?
Explain the difference between a Thread and a Process.