why the class's members should be add "var"/"val" or we could not visit them?
in scala, if we declare a class like this, it will compile error.
class A(a : Int) {}
val x = new A(3)
x.a // compile error
if we add val to the member a:
class A(val a : Int) {}
val x = new A(3)
x.a // compile pass
What is the difference between the two class ?