Warning: Tangential topic
Public attributes are not inherently evil. The problem with Java is that it doesn't have properties, which allow you to have exposed internal variables at the beginning. When your requirements for encapsulation grow stronger you can change the internals of the class without affecting its signature/API. With properties, you can have your cake and eat it too, you can access a property as a variable, but being unable to set/assign to it outside the class.
Java programmers get around this by creating from the start getters and setters for every public facing attribute, whether it has any kind of processing or not, just in case. I've seen Java programmers starting on other languages that do have properties doing the same sin of using getters and settersthing . Please, if you ever go to another language, don't bring all the misconceptions from Java born out of implementation details of the JVM.
Encapsulation != getters && setters.
</rant>