Is there a better standard way to create getters and setters in Java?
It is quite verbose to have to explicitly define getters and setters for each variable. Is ther
As a possible alternative, have you tried Scala? It compiles to Java bytecode, and has lots of interesting shortcuts which can make your life as a Java programmer easier.
Properties for instance:
case class Person(var name:String,
var age:Int);
val p = Person("John", 4)
p.name
p.name = "Charlie"
p.name
And the output:
defined class Person
p: Person = Person(John,4)
res7: String = John
res8: String = Charlie