Java OCA OCP Practice Question 3065

Question

Which one of the following interfaces is empty (i.e., an interface that does not declare any methods)?

  • a) java.lang.AutoCloseable interface
  • b) java.util.concurrent.Callable<T> interface
  • c) java.lang.Cloneable interface
  • d) java.lang.Comparator<T> interface


c)

Note

From the documentation of clone() method: "By convention, classes that implement this interface should override the Object.clone() method.

Note that this interface does not contain the clone method."

option a) the AutoCloseable interface declares the close() method.

option b) Callable declares call() method.

option d) the Comparator<T> interface declares compare() and equals() methods.




PreviousNext

Related