What is the purpose of `external` keyword in Kotlin?

匆匆过客 提交于 2019-12-23 07:00:56

问题


What exactly is the purpose of the external keyword in Kotlin?

I guess it's for JNI like native in Java, but I can't seem to find any actual reference or documentation on this.


回答1:


Indeed, it's an equivalent of Java's native. It's currently missing from the documentation but there's an issue to add it.




回答2:


According to documentation: external marks a declaration as implemented not in Kotlin (accessible through JNI or in JavaScript)



来源:https://stackoverflow.com/questions/35552834/what-is-the-purpose-of-external-keyword-in-kotlin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!