Discussion
Objects life time generally corresponds to which storage allocation mechanism from the following :
(i) Static objects
(ii) Stack objects
(iii) Heap objects
(iv) Serialised objects
Answer: B
The answer is (i), (ii) and (iii).
An object's lifetime is tied to how its storage is allocated. Static objects live for the whole run of the program, stack (automatic) objects live from their declaration until their block exits, and heap (dynamic) objects live from explicit allocation until they are freed or garbage collected. These are the three classic storage allocation strategies.
Serialisation turns an object into a byte stream for storage or transmission. It is not a storage allocation mechanism, so options naming (iv) are wrong, and (ii) and (iii) alone leaves out static objects.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development