- A Java objects are stored in a stack memory.
- B Java objects are stored in a heap memory.
- C Java objects are stored in a separate memory space called the "object memory."
- D Java objects are stored in a cache memory.
- Share this MCQ
Answer:
B
Share this MCQ
Java objects are stored in a heap memory, which is a section of memory that is shared among all threads in a process. The heap memory is managed by the JVM and is used to store objects and their associated data. The heap memory is divided into two parts: the young generation and the old generation. The young generation is used to store newly created objects, while the old generation is used to store objects that have been around for a while. The JVM also uses the heap memory to store static variables and class metadata.
Click me to Read more Question & Answer of Java Interviews MCQsShare this MCQ