Multiple choice

Declaring a class ______ prevents any unwanted extensions to the class.

  1. close

  2. terminate

  3. end

  4. final

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

Declaring a class as 'final' prevents it from being subclassed. This is a common practice to ensure the integrity of a class by preventing unwanted extensions.