Kotlin--TODO("not implemented")异常

   在kotlin实现接口的时候小白可能会遇到以下异常:

    抛出异常:kotlin.NotImplementedError: An operation is not implemented: not implemented

    在实现接口的时候IDE会自动为我们添加上:

    TODO("not implemented") //To change body of created functions use File | Settings | File Templates.

    “TODO("not implemented")”这句代码,这句代码在运行的时候会抛出以上异常,这样做的好处是促使我们去实现接口方法或者手动删掉这句代码。

    解决这个异常的方法就是删掉这行代码

猜你喜欢

转载自blog.csdn.net/flowerff/article/details/80081363
今日推荐