Back to Multiple Choice Quiz
Loop Output
Java quiz · Question 3What is the output of this code?
Code
1public class Main {2 public static void main(String[] args) {3 for (int i = 0; i < 5; i++) {4 if (i == 3) {5 break;6 }7 System.out.print(i + " ");8 }9 }10}