<Kotlin code calls java constants such as &lt;publ...
# stackoverflow
u
Kotlin code calls java constants such as &lt;public static final String x = "1"&gt; will be compiled failed, How to solve this problem? I have a kotlin file, I wanna use a java constant in this file, but I cann't compiled finally. So, is this the kotlin language features, or other result? Java Constants like this in class Constants: public static final String testCode = "101001001"; Kotlin Caller code like this: private fun testFunc(type: Int): String { when (type) { 1 -> return Constants.testCode; else -> return "" } }