Java Interfaces - Quiz Explanation

The correct answers are indicated below, along with the text that explains the correct answers.
 
1. All methods in an interface are
Please select the best answer.
  A. Final, unable to be overridden
  B. Class methods
  C. Abstract
  The correct answer is C.
All methods are abstract. It is up to the classes implementing an interface to provide their behavior.


2. All variables in an interface are
Please select the best answer.
  A. Static and final (that is, class variables and constants)
  B. Abstract instance variables
  C. Constant instance variables
  The correct answer is A.
All variables in an interface are implicitly static and final, which makes them class variables and constants.

3. A class named Primes implementing an interface named Runnable could be defined like this
Please select the best answer.
  A. class Primes extends Runnable...
  B. class Primes implements Runnable...
  C. interface Primes implements Runnable...
  The correct answer is B.
The keyword implements indicates that a class implements an interface.