Scala类中的属性
属性的声明方法1.1 在主构造器形参中声明class Student (val name: String,var age: Int){println(“Primary constructor and Auxiliary constructor!”)def fun = name + " is " + age +" years old!"}1234Scala 类的主构造器函数的形参包括三种类型:未用任何修饰、var 修饰、val 修饰:未用任何修饰符修饰,这个参数就是一个局部变量,但当.