Multiple choice general knowledge

In JAVA you can prevent others from extending your class by making it static using the keyword static in the class declaration.

  1. True

  2. False

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

In Java, the 'static' keyword makes a class member belong to the class rather than instances. To prevent inheritance, you use the 'final' keyword, not 'static'. A final class cannot be extended.