Important Java Mcq 1

Which of the following live on the heap in Java?

a) Class

b) Instance

c) Method

d) Object

Answer

d) Object

Explanation:

Heap space is utilized for the dynamic memory allocation of Java objects and JRE classes at runtime. New objects are always created in heap space, and the references to these objects are stored in stack memory. These objects have global access and we can access them from anywhere in the application.

Related MCQs
Aniket Malik

Aniket Malik

CERTIFIED TUTOR/TRAINER WITH 300+ REVIEWS

Facing difficulty with

this concept?