0 votes
in JAVA by
An interface with no fields or methods is known as a ______.

i) Runnable Interface

ii) Marker Interface

iii) Abstract Interface

iv) CharSequence Interface

1 Answer

0 votes
by

Marker Interface

Rreason: An interface with no methods and fields is known as the marker interface. In other words, an empty interface (containing no fields and methods) is called a marker interface. In Java, the most commonly used marker interfaces are Serializable, Cloneable, Remote, and ThreadSafe interfaces. Marker interfaces are also known as the Tag interface. It is used to tell the JVM or compiler that the particular class has special behavior.

Following is the code snippet of a maker interface:

public interface Cloneable 
{
    // empty 
}

Hence, the correct answer is option (ii).

Related questions

0 votes
asked Apr 8, 2021 in JAVA by SakshiSharma
0 votes
asked Apr 10, 2021 in JAVA by Robindeniel
...