I\'m new to Java, but have some OOP experience with ActionScript 3, so I\'m trying to migrate relying on stuff I know.
In ActionScript 3 you can create getters and sette
In Java, the only option you have without exposing the internals of your object is to make your own getters and setters as you have in your example.
The convention is to prepend get
or set
in front of the field which is being altered. So, as in your example, the field name
would have getName
and setName
methods as their corresponding getter and setter, respectively.