MCQ: Which of the following is a marker interface?

Which of the following is a marker interface?

  1. Runnable interface
  2. Remote interface
  3. Readable interface
  4. Result interface

Answer

a. Remote interface

Explanation:

Explanation: A marker interface is an interface with no fields and methods. In other words, an empty interface (contains nothing) is known as the marker interface. Examples of marker interfaces are Cloneable, Serializable, ThreadSafe, and Remote interface.

The Runnable, Readable, and Result interfaces are not marker interfaces as they contain some methods or fields.

Hence, the correct answer is an option (b).


Comments