As far as I know, when we pass an object reference to a method, changes we made to that reference inside the method directly affects the object. When I try to make the object reference null, it seems that the object reference is not set to null and I can still access the object information. Could you point out what causes this and why the object reference doesn't become null. Thanks. (My code is shown below)
public class Main {
public static void main(String[] args) {
Circle c1 = new Circle(5.8);
foo(c1);
System.out.println(c1);
}
public static void foo(Circle c){
c = null;
}
}