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

What are ejb components?

714


How to create ejb project in eclipse?

734


What is difference between ejb and spring?

760


What is the full form of ejb in java?

715


Is ejb be called from another ejb? If yes then how?

741


Enlist the enterprise beans types?

785


What is the use of @resource?

765


What do you understand by session facade?

746


What does ejb stand for?

823


What is stateless and stateful session bean in ejb?

676


What are the basic and subtypes of enterprise java beans (ejb)?

758


How to generate ejb stubs in eclipse?

951


Why should we use ejb?

705


How does ejbs work?

708


Explain the concept of connection pooling feature of ejb container?

729