Multiple choice technology programming languages

Which of the following are command-line switches used to disable assertions in non-system classes?

  1. -disableassertions

  2. -disableAssertions

  3. -assertionsDisable

  4. -assertionsOn

  5. -assertionsOff

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

The Java compiler flag -disableassertions disables assertions in non-system classes. This is the standard switch to turn off assertion checking for application code. Option B is incorrect because Java switches are case-sensitive and use the exact spelling -disableassertions.