I added my own getter and setter to the variable:
class Person{ private var age = 0 def currentAge = age def currentAge_=(age: Int) = this.age = age }
Looking at the compiled version, you can:
public class Person implements scala.ScalaObject { private int age; private int age(); private void age_$eq(int); public int currentAge(); public void currentAge_$eq(int); public Person(); }
I want to avoid the default automatic generation and getter setter. Is it possible?
damluar
source share