How can we ensure the immutability of a ArrayList defined in a Immutable Object?

Viewed 70

If I am defining an ArrayList in Java which is private, final and only with getters. Still user can get the ArrayList and modify the ArrayList by adding or removing the elements from it. How can I avoid this?

3 Answers
Related