Skip to main content

Unit 3 · Class Creation

Methods and Parameters

Methods and Parameters MCQ Practice

Question 1 of 15

Answered 0 of 15

Choose one answer.

What is printed by the following code segment?

public class MethodsAndParametersContext
{
    public static int twice(int n)
    {
        return n * 2;
    }

    public static void main(
        String[] args)
    {
        System.out.print(twice(3) + twice(4));
    }
}
Choose one answer.