https://kotlinlang.org logo
Title
x

xxxifan

03/03/2017, 2:54 PM
the kotlin icon come out!
r

robin

03/03/2017, 2:54 PM
xxxifan: After declaring it outside the class? That's curious, it should also work inside the class.
Okay, doesn't for me either. Strange.
Okay but now that we have that, click it and run the program. After you've done that you'll have a new, temporary run configuration which you can then save as a permanent one.
x

xxxifan

03/03/2017, 2:55 PM
yes, I can run it now, thank you very much!
r

robin

03/03/2017, 2:56 PM
NP. And I just remembered why having it inside a class doesn't work - you need to have the function in the companion object of the class and annotate it with
@JvmStatic
if you really need it in the class.
👍 2