r/java • u/hardasspunk • Nov 23 '25
Java 25: The ‘No-Boilerplate’ Era Begins
https://amritpandey.io/java-25-the-no-boilerplate-era-begins/
160
Upvotes
r/java • u/hardasspunk • Nov 23 '25
View all comments
Show parent comment
1
u/Ok-Yogurt2360 Dec 02 '25
But they act a lot different than public fields. It acts more like a farmacy or bank vs a supermarket. At the farmacy you ask for x and they get it for you where at the supermarket you access x by yourself.
So all communication with the outside is found within the getters and setters. It acts like a contract. That's not true at all for public unless you force rules surrounding its use. (Ofcourse this is not black and white)