Java Control Flow

Programming Language > Java Programming Language

Assess your knowledge of Java control flow with these multiple choice questions. Learn about the different control structures in Java and how to use them to control the flow of a program. Take the quiz now! ➲ Java Control Flow - Quiz


  • A The program has a compile error because the adjustment is missing in the for loop.
  • B The program has a compile error because the control variable in the for loop cannot be of the double type.
  • C The program runs in an infinite loop because d<10 would always be true.
  • D The program compiles and runs fine.
  • A for(; ;)
  • B for(i=0 ; i<1; i--)
  • C for(i=0; ; i++)
  • D All of the above
  • A 1 2 3 1
  • B 1 2 3 2
  • C Repeatedly print 1 2 3 and cause infinite loop.
  • D Compilation fails because of line 2