what is the output of below code? what will it print?
class SimpleObj {
int i;
}
public class PassObject {
public static void passObject(SimpleObj from, SimpleObj to) {
to = from;
}
public static void main(String[] args) {
SimpleObj obj = new SimpleObj();
SimpleObj from = obj;
SimpleObj to = null;
passObject(from, to);
System.out.println(to.i);
}
}
--
Regards,
Rajesh.I