Tag: general knowledge

Questions Related to general knowledge

Multiple choice general knowledge science & technology
  1. The program has a syntax error because the required break statement is missing in the switch statement

  2. The program has a syntax error because the required default case is missing in the switch statement

  3. The switch control variable cannot be double

  4. No errors

Reveal answer Fill a bubble to check yourself
C Correct answer
Multiple choice general knowledge science & technology
  1. The program cannot compile because the compiler cannot determine which max method should be invoked

  2. The program cannot compile because you cannot have the print statement in a non-void method

  3. The program runs and prints "max(int, double) is invoked" followed by 2

  4. The program runs and prints "max(double, int) is invoked" followed by 2

Reveal answer Fill a bubble to check yourself
A Correct answer
Multiple choice general knowledge science & technology
  1. The program runs and prints 2 once

  2. The program runs and prints 2 twice

  3. The program has a syntax error because the second m method is defined, but not invoked in the main method

  4. The program has a syntax error because the two methods m have the same signature

Reveal answer Fill a bubble to check yourself
D Correct answer