Submitted by heartin on Sun, 09/27/2015 - 18:19
Find output:
public class MyClass {
int id;
public static void main(String[] args) throws Exception {
MyClass mc = new MyClass();
mc.id=10;
System.out.println(((MyClass)mc.clone()).id);
}
}
Submitted by heartin on Sun, 09/27/2015 - 18:16
Find output:
public class MyClass {
int id;
public static void main(String[] args) throws Exception {
MyClass mc = new MyClass();
mc.id=10;
System.out.println(mc.clone().id);
}
}