object StaticFun {
fun show(){
println("StaticFun 这个类的单例调用 show()")
}
//only members is named objects or companion objects of class can be annotated with '@JvmStatic'
@JvmStatic
fun show1(){
println("StaticFun 这个类 直接调用show1(),show1()is a static function")
}
}
网友评论