Kotlin: Interface … does not have constructors

前端 未结 7 1136
长情又很酷
长情又很酷 2020-12-04 16:14

I am converting some of my Java code to Kotlin and I do not quite understand how to instantiate interfaces that are defined in Kotlin code. As an example, I have an interfac

相关标签:
7条回答
  • 2020-12-04 16:45

    Try to access to your interface like this :

     object : MyInterface {
        override fun onSomething() { ... }
    }
    
    0 讨论(0)
提交回复
热议问题