What is the reason that multiple inheritance is not possible
in java??
Answer / gayathri
This is to avoid "Diamond problem"....Lets say there are 4 classes A,B,C,D..A is a superclass...The two classes B and C inherit from A, and class D inherits from both B and C. If a method in D calls a method defined in A (and does not override the method), and B and C have overridden that method differently, then from which class does it inherit: B, or C? ...To avoid this issue, Java dint allow multiple inheritance..
Having said that, also note that Java allows multiple inheritance through multiple interface implementation
| Is This Answer Correct ? | 10 Yes | 1 No |
What is the difference between an if statement and a switch statement?
Is null a string or object in java?
What are the actions that can occur when a thread enters blocked state?
What is the meaning of variables in research?
What is a module function?
Can we create an object of static class in java?
Write a method to check if input string is palindrome?
What will happen inside init() in servlet. my interviewer asked servlet lifecycle. i said "once servlet is loaded in to memory init() will be called which performs servlet initialization " . Again interview asked what values will be initialized . what is difference between init() and init(ServletConfig config).
2 Answers Infinite Computer Solutions, TCS,
What are conditionals and its types?
What are the features of java?
Explain oops concepts in detail?
When do I need to use reflection feature in java?