الرجوع
تسجيل الدخول

What is the output of the program?

class Wrapper {
    Integer num;
    Wrapper(Integer num) {
        this.num = num;
    }
}

public class Test {
    public static void main(String[] args) {
        Wrapper w = new Wrapper(100);
        modifyWrapper(w);
        System.out.println(w.num);
    }

    static void modifyWrapper(Wrapper w) {
        w.num = 200;
    }
}