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 an ejb container?
Which services are provided to ejb components by the ejb container?
What is the advantage of using entity bean for database operations, over directly using jdbc api to do database operations? When would I use one over the other?
What is a ejb container?
What is session bean?
Is it possible to share an httpsession between a jsp and ejb?
Enlist the changes in EJB 2.1 ?
What is dependency injection in ejb?
What are the callback annotations for entity bean?
What is ejb application?
What is difference between stateless and stateful?
What does @inject mean in java?
What do you mean by EJB architecture?
What is entity bean?
What are the callback annotations for the stateless bean?