1DayWeek dw = new DayWeek(5);
2DayWeek dw2= null;
3boolean b;
4
5b = dw==dw2; // b = false
6dw2 = dw; // dw2 and dw are equal
7b = dw==dw2; // b = true
8
9// references to different memory areas
10DayWeek dw3 = new DayWeek(3);
11DayWeek dw4 = new DayWeek(3);
12
13if (dw3==dw4)
14 b = true;
15else
16 b = false; // b = false