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

W

hat the output of the given code is. The class structure is:

public class Mystery {
    public int i = 0;
    public static int j = 0;

    public Mystery(int x) {
        i += x;
        j += x;
    }

    public static void main(String[] args) {
        Mystery ob1 = new Mystery(3);
        Mystery ob2 = new Mystery(2);
        System.out.print(ob2.i + "," + ob2.j);
    }
}