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?
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?