All objects are stored in Heap

Primitive values are stored in stack

 

 

 

 

 

 

 

 

 

You will see compiler error at c = new Customer(“Susan”);  due to final variable.

 

But it is valid.

 

 

 

 

 

 

 

Even it is cleared, still it will return values

Because getCustomers() is creating new copy of the instance.

 

 

Record.getCustomers().clear() will throw error. Because we cannot modify