I am trying to make sense of methods definitions with no arguments and parentheses. In the main method, last one does not work. What is the explanation for that semantically or syntactically?
class X(x:Int){
def getX1() = x;
def getX2 = x;
}
object X {
def main(args: Array[String]) {
val x = new X(123)
println(x.getX1)//works
println(x.getX1())//works
println(x.getX2) //works
println(x.getX2())//does not work
}
}