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 static and final keyword in java?
Can we overload the methods by making them static?
Write a regular expression to validate a password. A password must start with an alphabet and followed by alphanumeric characters; its length must be in between 8 to 20.
What is variable explain?
If system.exit (0); is written at the end of the try block, will the finally block still execute?
How to retrieve data from database in java using arraylist?
Can we increase array size dynamically in java?
Is it necessary that each try block must be followed by a catch block?
What is variable in java?
What is string pool?
what is the significance of listiterator in java?
What is a java predicate?
How does a cookie work in Servlets?
Can one thread block the other thread?
What is the purpose of javac exe?