in the below 2 posted examples, i am trying to convert the java code to kotlin code.
the kotlin code does not work and IntelliJ says that I should use companion object.
please let me know how to correct this error.
code_kotlin*
@SpringBootApplication
class MyApplication {
}
fun main(args: Array<String>) {
SpringApplication.run(MyApplication::class.java, *args)
}
codeJava
@SpringBootApplication
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}