aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programming Languages: C, Java, Perl Features
  • Which of the following are command-line switches used to ...
Multiple choice technology programming languages

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

  1. -ea

  2. -ae

  3. -aon

  4. -assertionsenable

  5. -enableassertions

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

Java provides two valid command-line switches to enable assertions: -ea (short form) and -enableassertions (long form). Options like -ae, -aon, and -assertionsenable are invalid.

Keep practicing — related questions

  • Which of the following are command-line switches used to disable assertions in non-system classes?
  • Given the following directory tree, you must enable assertions for everything except for FileTwo. base |_fi...
  • class C { String m1(int i) { switch (i) { case 0: return "A"; case 1: return "B"; case 2: return "C"; defau...
  • class A { void m1(int i) { int j = i % 3; switch (j) { case 0: System.out.print("0"); break; case 1: System...
  • Which of the following statements is true?
  • Which of the following are appropriate ways to use assertions? (Choose all that apply) You have not made an...
  • public class Test2 { public static int x; public static int foo(int y) { return y * 2; } public static void...
  • public class Test2 { public static int x; public static int foo(int y) { return y * 2; } public static void...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy