1 public class CardBoard {
2Short story = 5;
3
4CardBoard go(CardBoard cb) {
5cb = null;
6return cb;
7}
8
9public static void main(String[] args) {
10CardBoard c1 = new CardBoard();
11CardBoard c2 = new CardBoard();
12CardBoard c3 = c1.go(c2);
13c1 = null;
14//System.out.println("c1....."+c1.story);
15System.out.println("c2....."+c2.story);
16//System.out.println("c3....."+c3.story);
17}
18 }
In the above example,line 14 & line 16 are compilation errors.because both objects are null.That objects are eligible for GC.