Kotlin Notes
kotlin delay:
CoroutinesScope(Dispatchers.Main).launch{
delay(100)
println("Print Something")
}
kotlin Extention Function:
fun main() {
val number = readLine()?.Int
println(number.IsPrime())
}
fun IsPrime(): Boolean {
for(i in 2..this-1){
if(this % 2 == 0){
return false
}
return true
}
}
kotlin Object Class:
fun main() {
val temp = ImportantNumber.PI
}
object ImportantNumber {
val PI = 3.1416
}
Comments
Post a Comment