a is assigned a stack memory location large enough to hold a pointer to the heap that could store class A. It is not initialized so points to garbage. Attempting to read it generates an error message. After writing to it with new A() or other initialization, you can read it and access the heap memory stored there.
Programmer</> Ah, well your question is with memory. Using the logic of having a default constructor what happens in memory is essentially A a; sets aside memory for your object. Then setting a= new A; it fills that memory with your object's value.
John Wells my another ques is that what reallyy happens in memory when we create object of main class inside its main () function...& what happens in memory when we create object of nested class of main class inside its main() method??
https://code.sololearn.com/crP73lVS4tH6/?ref=app....right plz help me in LinkedList program. here in line no 12..why we created ref-variable first of Node (Inner) class outside the i mean in Linked List....my question is that why we can created Node first; inside node class?