What is the reason for using “Kt” suffix in Kotlin classes?

后端 未结 1 1158
别跟我提以往
别跟我提以往 2021-01-05 19:13

I was trying to find more details about this decision in the Kotlin documentation but there is no section that \"talks\" about it. Does anyone know what drove the decision t

相关标签:
1条回答
  • 2021-01-05 20:04

    Unlike Java, Kotlin allows you to define functions that are not inside a class. But if you want Java to talk to Kotlin that becomes a problem. How to solve it? Convert those functions into static methods of a class named as the file with the "Kt" suffix

    You can find more info about that in the documentation

    0 讨论(0)
提交回复
热议问题