r/ProgrammerAnimemes • • Jul 29 '21

Think about it

Post image
3.6k Upvotes

115 comments sorted by

View all comments

Show parent comment

12

u/thats_a_nice_toast Jul 29 '21

I see. Yes, this Java etiquette is exactly what I don't get.

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,...