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
can u explain about design patterns like singleton,builder,factory
What is the new basic requirement for a cmp entity bean class in 2.0 from that of ejb 1.1?
How entity beans support container managed persistence?
What is stateful or stateless?
What is ejb role in j2ee?
Which is the only method defined in the javax.ejb.handle interface?
How does ejbs work?
What is session bean in ejb?
How does the server decide which beans to passivate and activate?
What is the procedure of ejb container to handle exceptions?
What is pub/sub model?
What is stateful session bean?
An instance of stateful session ejb when accessed simultaneously from more than one clients on same vm results in remoteexception or ejbexception. In case the client is a servlet thread, which of the techniques can be used to avoid remoteexception/ejbexception?
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?
What is EJB object?