Limited access

Upgrade to access all content for this subject

Consider the following method.

public static void incrementDecrement(int x)
{
    System.out.print(++x);
    System.out.print(x++);
    System.out.print(--x);
    if (x++ == 5)
        return;
    System.out.print(x--);
    System.out.print(x);
}

What is printed as a result of the method call incrementDecrement(4)?

A

454

B

555

C

55555

D

55565

E

An error occurs because void methods cannot return a value

Select an assignment template