Originally posted by Seema Das:
Hi all,
In this book there is question 6.12 which is as follows:
Q. Which of these statements about interfaces are true?
Select all valid answers.
a) Interfaces permit multiple implementation inheritance.
b) Interfaces can be extended by any number of other interfaces.
c) Interfaces can extend any number of other interfaces.
d) Members of an interface are never static.
e) Members of an interface can always be defined static.
and the correct answer is : b and c
I don't understand how c is correct. Interfaces can IMPLEMENT many other interfaces, how can they EXTEND any number of interfaces?
does any one know why c is a valid statement?
Thanks
Yes as regard to Interfaces we can use multiple inheritance ( not multiple implementation inheritance )
Statement: interface mylistener extends windowListener, actionListener
is perfectly valid, because
java allows multiple inheritance in case of interfaces and not in case of classes. For further detail see page 197 Extending Interfaces (khalid A Mughal)