For the record, I am NOT a Java newbie, but rather a mid-level guy who has forgotten a bit about the basics of Java.
class C {
public static void main (String a []) {
C c1 = new C ();
C c2 = m1 (c1); // line 4
C c3 = new C ();
c2 = c3; // line 6
anothermethod ();
}
static C m1 (C ob1) {
ob1 = new C (); // line 10
return ob1;
}
void anothermethod () {}
}From the code above:
Why, after line 6, are 2 type objects available Cfor garbage collection (GC)?
, 4 10, c1 m1(). , 6, 1 ( 2), GC. , java pass-by-value, pass-by-reference?