Multiple choice

Which of the following statements are true? i. An abstract class may not have any final methods. ii. A final class may not have any abstract methods. iii. An inner class may be declared with any accessibility keyword. iv. Transient variables must be static.

  1. ii & iii

  2. i & ii

  3. i & iv

  4. iii & iv

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Statement ii is true because a final class cannot be extended, so abstract methods (which require implementation) cannot exist. Statement iii is true because inner classes can have any access modifier. Statement i is false (abstract classes can have final methods), and iv is false (transient variables do not have to be static).