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 is ejb role in j2ee?

832


How to create ejb project in eclipse?

758


What are the attributes of transaction in ejb?

718


What do you mean by timer service and where it is used?

766


What are the differences between ejb 3.0 and ejb 2.0?

732


What does it mean to be stateless?

758


What are the components of session beam?

838


What is stateless authentication?

774


Is decorator an ejb design pattern?

878


What is session facade in ejb?

769


How to find ejb version in websphere?

732


What does @singleton annotation do?

773


What is @autowired required false?

794


What are the limitations of using local object?

746


Is udp stateless?

778