CJCoding With Joseph
15per day
← Back to Question List

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics:
Java Quiz #3

Loop Output

mediumLoops

What 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}