Question { 8179 }
In which memory a class gets stored(in heap /in stack)?
And why??
Answer
The stack is a place in the computer memory where all the variables that are declared and initialized before runtime are stored. The heap is the section of computer memory where all the variables created or initialized at runtime are stored.
Hence,classes will be stored in heap memory.