1.

Encapsulation helps in writing ___________ classes in java.(a) Mutable(b) Abstract(c) Wrapper(d) ImmutableI have been asked this question during an internship interview.Asked question is from Encapsulation in section OOPs Concept & Features of Object Oriented Programming

Answer» CORRECT answer is (d) IMMUTABLE

Easy explanation - Immutable classes are USED for caching purpose GENERALLY. And it can be created by making the CLASS as final and making all its members private.


Discussion

No Comment Found

Related InterviewSolutions