java doesnot support multiple inhetance. but a interface can
support.how the ambiguities are rectified in interfaces?
Answer Posted / manish
There are some reasons because of them java soft remove
multiple inheritance -
Suppose there are 4 classes A,B,C,D.
Class A - contains some abstract methods, final methods,
private methods.
Class B - contains some complete methods, some final
methods.
Class C - contains some static methods, complete methods.
Class D - contains some final methods, static final methods
and so on..
And programmer create a subclass for extending these 4
classes like this -
public class ChildClass extends A,B,C,D
{
---------
--------- // lots of confusions for programmer here.
}
The subclass programmer may be confused. Because he need to
concentrate on what are availables in supper classes. Thats
why java soft people remove multiple inhiritance.
But in case of Interface --
public interface childInterface extends Interface_A,
Interface_B, Interface_C, Interface_D
{
--------
-------- // No confusion here. Because Interface contains
only abstract methods. And abstract method doesn't have
body.
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is the procedure of ejb container to handle exceptions?
What is @resource in java?
Enlist the CallBack methods of Entity Bean.
What is an entity manager?
What does @inject mean in java?
What is difference between ejb and spring?
Can beans who are involved in transaction have 'passivation' process?
What is ejb application?
How is consistency maintained by Stateful Session through transaction updates ?
What are the advantages of ejb?
What does it mean to be stateless?
What do you mean by bean managed transaction?
Why should we use ejb?
In what format is the conversational data written to the disk?
A client wants to preserve the reference to the ejbhome object of an enterprise bean instance and use it later. Which of the following can be serialized for this purpose?