Can an interface extend any number of interfaces?? If yes can anyone give some examples in the JDK of such interfaces. Thanks Sagar
Ahmad Mudassir
Greenhorn
Joined: Oct 16, 2000
Posts: 10
posted
0
you can extends interface from interface no restriction and as many as you can. real example from jdk is Externizable extends Serializable which i know. Ahmad
Sagar Sharma
Ranch Hand
Joined: Aug 31, 2000
Posts: 92
posted
0
my question was the can an interface extend 2 or more interfaces??? Pls give ur reply Sagar
Ahmed Nasir
Ranch Hand
Joined: Sep 25, 2000
Posts: 57
posted
0
Hi Sagar No not at all, an interface or a class can never extend more than one interfaces or classes. As its gonna completely break the Single Inheritance rule of Java. what do you think..please post if you need more clarification. cheers Nasir
Manuel Palacio
Ranch Hand
Joined: Oct 16, 2000
Posts: 45
posted
0
Yes! Any interface can extend any number of other interfaces. This is in contrast to the linear inheritance hierarchy between classes.
[This message has been edited by Manuel Palacio (edited October 17, 2000).]
http://www.javaprepare.com/quests/test.html At the above URL in Q No. 43, one of the answers is (c) which means that extending from multiple interfaces is possible. Pls have a look and comment on the same.
Sagar
sasuke sarutobi
Greenhorn
Joined: Oct 11, 2000
Posts: 7
posted
0
Look at JLS: 9.1.2 Superinterfaces and Subinterfaces
Originally posted by Sagar Sharma: http://www.javaprepare.com/quests/test.html At the above URL in Q No. 43, one of the answers is (c) which means that extending from multiple interfaces is possible. Pls have a look and comment on the same.