静态常量
object LIST{
var BILL_CODE:String = "bill_code"
}
静态方法
companion object{
fun getInstance():Fragment{
return Fragment()
}
}
然后在java类中调用
Fragment.LIST.INSTANCE.getBILL_CODE()
Fragment.Companion.getInstance()
kotlin中调用
Fragment.LIST.BILL_CODE
Fragment.getInstance()