2 ms·
> You should make bar private It's package-access by default, that's enough to hide it from the third-party users of the class. > and add a setter The origin
by masklinn 16y ago
> You should make bar private
It's package-access by default, that's enough to hide it from the third-party users of the class.
> and add a setter
The original code uses `attr_reader` which defines a readonly "property". The Java translation is a single getter, with no way to set the value from outside the class.