1、编写数据类 class testConstant{ companion object{ val hi = "nihao" } } 2、使用 testConstant.Companion.getHi()