code:
Class CardBoard{
Short story=5;
CardBoard go(CardBoard cd){
cd=null;
return cd;}
public static void min(String ags[]){
CardBoard c1= new CardBoard();
CardBoard c2=new CardBoard():
CardBoard c3= c1.go(c2);
c1=null;
}
}
There would be only one object for Garbage collection.
While you pass c2(copy of reference)in method
go() and made it null, still it's original object's reference is maintained by c2,see before line
CardBoard c3= c1.go(c2); and finally you made c1 as null so Object referred by c1 becomes eligible for garbage collection....
