Could someone tell me if a NULL object occupies memory?
I have the following Scenario, I have a class A
, B
and C
, and class B
and C
is inside the class A
, then how would the memory be in these 3 scenarios ?
1. ClassC C = null;
2. ClassA A = new ClassA()
A.B = new ClassB();
A.C = null;
3. ClassA A = null;
In those 3 scenarios, how is memory allocation? if it is NULL, does it not use memory? or how those scenarios are handled internally.