Q. Which of the following is the correct syntax for a for loop in Java?
β
Correct Answer: (A)
for (int i = 0; i < 10; i++) { System.out.println(“Hello”); }
Explanation: The for loop initializes a counter variable, tests a condition, and increments the counter variable on each iteration.