摘要: 主构造函数没有函数体,如果想在主构造函数中写一些逻辑,Kotlin提供了一个init结构体,所有主构造函数中的逻辑都可以写在里面: class Student(val sno: String, val grade: Int) : Person(){ init { println("sno is $s 阅读全文
posted @ 2024-02-21 21:24 touchmore 阅读(18) 评论(0) 推荐(0) 编辑