Re:Java 1.0 Turns 25
by JulianMorrison on Saturday January 23, 2021 @11:08AM
(#25883243)
Public writeable fields are threading and encapsulation smells but public read-only fields just say, this data is part of my interface.
[ Parent
| on HN ]
well, yes however fields cannot be part of an 'interface' in java. (they can but they'd be static)
I do use package private fields liberally, though. Just not non-static public fields.
Re:Java 1.0 Turns 25
by JulianMorrison on Sunday January 24, 2021 @06:55PM
(#25897475)
Interface as used here means the broader concept of a "a class's interface is its public advertised operations" and not the specific Java thing called an interface.