2020
09-24
09-24
Kotlin 创建接口或者抽象类的匿名对象实例
一,定义接口和抽象类interfaceIPerson{//获取名字fungetName():String//获取身份证IDfungetID():String}abstractclassBaseAnimal{abstractfungetVoice():String}二,创建对应的匿名对象object:IPerson{overridefungetName():String="jason"overridefungetID():String="00000123"}object:BaseAnimal(){overridefungetVoice()="旺旺叫"}补充知识:androidKotlin继承、派生、接...
继续阅读 >