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


Please Help Members By Posting Answers For Below Questions

can u explain about design patterns like singleton,builder,factory

1884


What is the new basic requirement for a cmp entity bean class in 2.0 from that of ejb 1.1?

560


How entity beans support container managed persistence?

1929


What is stateful or stateless?

524


What is ejb role in j2ee?

575






Which is the only method defined in the javax.ejb.handle interface?

625


How does ejbs work?

503


What is session bean in ejb?

510


How does the server decide which beans to passivate and activate?

525


What is the procedure of ejb container to handle exceptions?

538


What is pub/sub model?

504


What is stateful session bean?

558


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?

557


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?

522


What is EJB object?

579