Skip to main content

Unit 2 · Selection and Iteration

For Loops

For Loops MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

public class ForLoopsContext
{
    public static void runExample()
    {
        for (int i = 0; i < 4; i++)
        {
            System.out.print(i);
        }
    }

    public static void main(String[] args)
    {
        runExample();
    }
}
Choose one answer.