Give the following code:
class A { Boolean b; A easyMethod(A a){ a = null; return a; } public static void main(String [] args
Can you please me explain me why a2 and a3 aren't being garbage collected ?
Because a2 and a3 are not objects. They are variables. Variables are not collectable for the simple reason that they are not allocatable.