Limited access

Upgrade to access all content for this subject

Consider the following class.

public class MathTime 
{
    private int num1 = 100;
    private int num2 = 20;

    public MathTime(int num1, int num2)
    {
        this.num1 = num1;
        this.num2 = num2;
    }

    public void printNums()
    {
        int num1 = num2 + this.num1;
        System.out.println(num1 + ", " + num2);
    }    
}

What will be printed to the console when the following code is executed from a client class?

MathTime math = new MathTime(8, 16);
math.printNums();
A

80, 20

B

100, 20

C

120, 20

D

8, 16

E

24, 16

Select an assignment template