其他分享
首页 > 其他分享> > shuju

shuju

作者:互联网

class Student(name:String,var age: Int){

def printInfo():Unit = {
println(name + ""+ age + "" + Student.school)
}
}
object Student{
val school:String= "zml"

def main(args: Array[String]): Unit = {
val zml = new Student("zml", 18)
val zxc = new Student("zxc", 16)
zxc.age = 22

zml.printInfo()
zxc.printInfo()
var mn:Int = 60
val pl:Int = 5
var y:Int =mn+pl
}
}

标签:zxc,val,zml,Int,Student,shuju,String
来源: https://www.cnblogs.com/zml603/p/16278821.html