How multipleInheritance is possible in java?

Answer Posted / harikrishna

Hi, Aruna how r u doing?

In Java multiple inhritance provided through interfaces
by extending morethan one interface. We can extend more
than one class in C++. But this is not possible in java
that's why java doesn't support mutiple inhritance
directly.
public interface GroupedInterface extends Interface1,
Interface2,
Interface3

An interface can extend other interfaces, just as a class
can extend or subclass another class. However, whereas a
class can extend only one other class, an interface can
extend any number of interfaces. The interface declaration
includes a comma-separated list of all the interfaces that
it extends.
Aruna if you still not understood please
go through
http://java.sun.com/docs/books/tutorial/java/IandI/createint
erface.html this site. if you understad it' good. give me
feed back.
Thanq

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a vector contain heterogenous objects?

797


What is close method? How it's different from Finalize & Dispose?

776


Is an object null?

726


Is a copy constructor?

809


What are the advantages of exception handling in java?

823


Why string is not thread safe?

758


Differentiate between a constructor and a method? Can we mark constructors final?

936


What is the static field modifier?

805


What is difference between static variable and global variable?

765


Is string is a data type in java?

798


Explain different forms of polymorphism?

855


What are void methods?

786


What is a classloader in java?

726


In Java list the methods that can be overridden?

775


What is difference between static and final?

748