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 ejb role in j2ee?
How to create ejb project in eclipse?
What are the attributes of transaction in ejb?
What do you mean by timer service and where it is used?
What are the differences between ejb 3.0 and ejb 2.0?
What does it mean to be stateless?
What are the components of session beam?
What is stateless authentication?
Is decorator an ejb design pattern?
What is session facade in ejb?
How to find ejb version in websphere?
What does @singleton annotation do?
What is @autowired required false?
What are the limitations of using local object?
Is udp stateless?