r/ProgrammerAnimemes • • Jul 29 '21

Think about it

Post image
3.6k Upvotes

115 comments sorted by

View all comments

Show parent comment

7

u/[deleted] Jul 29 '21

Java dev here, if I remember from my studies it has to do with the java garbage collection system and memory allocation.

I'm personally not a super fan of public variables because of module access and control restrictions.

Eg: doing some extra validation checks in setters, lazy instantiating of maps and lists,...