Question 0-1

Using the following method, what are the values of the following expressions?

public static int f(int x) {
    int y = 4 * x;
    if(y < 10) return y;
    y++;
    return y / 6;
}
a.15 - 1 - 3 * 2
b.15 - 12 % 5
c.f(1)
d.f(f(4))

Solution

a.8
b.13
c.4
d.8

Back to Review for Quiz 0