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


a. Remote interface


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).

Free Spring Boot Tutorial - 5 Hours Full Course

Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course