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

What is try-with-resources in java?

601


What is mean by encoding?

622


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

587


How is garbage collection controlled?

725


What is the statements?

585






Is integer passed by reference in java?

558


Is null a value?

554


Can you call a method in a method?

523


What is the use of using enum to declare a constant?

548


What is temp in java?

543


What is java life cycle?

530


What are the data types supported by java? What is autoboxing and unboxing?

539


What types of index data structures can you have in java?

606


What is the use of a conditional inclusion statement in Java ?

582


What is bufferedreader in java?

576