32.1k views
5 votes
Which of the following statements is correct?

A) Interfaces are classes.

B) A class can implement more than one interface type.

C) All fields in an interface are private.

D) A class can implement only one interface type.

1 Answer

4 votes

Answer:

B) A class can implement more than one interface type.

Step-by-step explanation:

A Java class can implement multiple interfaces.

For example:

class Test implements java.io.Serializable,java.lang.Runnable{

/* The class should contain method signatures for all the methods defined in all the interfaces it implements */

}

Note that a java class can inherit from only one superclass but this restriction is not applicable while implementing multiple interfaces.

User Rickcnagy
by
5.4k points