0
public class TestA {
     public static void a() {}
} 

fun TestA.b(){}

How can I extension Java class with Kotlin to use like static fun ? just like TestA.b() to use this fun

zsmb13
  • 85,752
  • 11
  • 221
  • 226
wanbo
  • 868
  • 9
  • 24
  • Do you need to call Java static function from Kotlin? Or do you want to extend Java class with static function? – asm0dey Apr 16 '18 at 04:42
  • I don't think it possible, you can check out this [answer](https://stackoverflow.com/questions/33911457/how-can-one-add-static-methods-to-java-classes-in-kotlin) – Hussain Apr 16 '18 at 04:42

1 Answers1

2

Actually, it is currently not yet supported to statcally extend a Java-Class. See the corresponding issue

https://youtrack.jetbrains.com/issue/KT-11968

guenhter
  • 11,255
  • 3
  • 35
  • 66