Multiple choice technology programming languages

A class cannot be declared

  1. volatile

  2. private

  3. default

  4. static

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

In Java, a top-level class cannot be declared private - it can only be public or package-private (no modifier). Private only applies to nested classes. Volatile, static, and default (package access) modifiers are valid for classes. The claimed answer B is CORRECT.