Multiple Choice Question

Quiz Guidelines

 

QID: 
108
Question: 

What will the following program print when run?

public class ChangeTest {
    private int myValue = 0;
    
    public void showOne(int myValue){
        myValue = myValue;
    }
    
    public void showTwo(int myValue){
        this.myValue = myValue;
    }    
    public static void main(String[] args) {
        ChangeTest ct = new ChangeTest();
        ct.showOne(100);
        System.out.println(ct.myValue);
        ct.showTwo(200);
        System.out.println(ct.myValue);
    }
}

Select 1 option

A. 0 followed by 100.
B. 100 followed by 100.
C. 0 followed by 200.
D. 100 followed by 200.

Q&A Set: