Kotlin Compiler - AutoGenrated class


test.kt  - file name

fun main(args : Array <String>){
}

-> in kotlin we can write a code without class .... yes for us it not compalasry
to write a class

-> In this example we simply write a code without class ... when we copile this code compiler will genrate class own

gnerated class file is : TestKt - after compilation auto generated class


=============================================


                    How to provide class name to compiler : 


In kotlin there is one annotation : @file JvmName("Demo")


 @file JvmName("Demo")

fun main(args : Array <String>){
}

test.kt 

 In this example after compilation kotlin compiler creates class name as

kotlin test.kt
kotlin Demo

================================================

Comments

Popular posts from this blog

Filter In Javafx

Kotlin with StandAlone Complier