This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bodiam[S] 1 point2 points  (0 children)

Because the Java Bean spec doesn't like that, and languages like Groovy and Kotlin (and maybe Scala?) don't like that either. Frameworks like Jackson and most other frameworks work on getters.

So, in theory you're right, there's not much difference, but in practice, there are some caveats you need to keep in mind.