Examveda
Examveda

Which of the following is true?
1. A class can extend more than one class.
2. A class can extend only one class but many interfaces.
3. An interface can extend many interfaces.
4. An interface can implement many interfaces.
5. A class can extend one class and implement many interfaces.

A. 1 and 2

B. 2 and 4

C. 3 and 5

D. 3 and 4

E. 2 and 5

Answer: Option C


This Question Belongs to Java Program >> Inheritence

Join The Discussion

Comments ( 3 )

  1. Navyasri Erramsetty
    Navyasri Erramsetty :
    3 years ago

    Here only 2 and 5 are correct.. 3 is not correct because a class can never extend a interface it only implements any number of interfaces. And here 2 is correct because a class can extend only one class but implement many interfaces.

  2. Ummadi Veena
    Ummadi Veena :
    6 years ago

    3rd statement is correct because there is no parent class for interface. In case of a class , the super class is object class.
    Ex: class A extends Interface1, Interface2, Interface3..... Hence multiple interfaces can be inherited.

  3. Niroshan Kumarasamy
    Niroshan Kumarasamy :
    7 years ago

    can you give simple example of An interface can extend many interfaces?

Related Questions on Inheritence

What is inheritance in Java?

A. The process of acquiring properties and behaviors of one class by another

B. The process of creating objects

C. The process of encapsulation

D. The process of overloading methods