Created
April 11, 2024 06:38
-
-
Save jonathanwork/1b5423b0e160571a8fbc18d57c7c84fb to your computer and use it in GitHub Desktop.
simple notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
fun typeface() { | |
val greet = "hello" | |
println(greet) | |
println(greet::class) | |
println(greet.javaClass) | |
} | |
fun nofluff() { | |
println("nofluff called... " ) | |
throw RuntimeException("oops") | |
} | |
fun compute(n : Int) = n | |
fun portal() = println(compute(20)) | |
fun main() { | |
portal() | |
println("not in a function, calling nofluff") | |
println("lemme take the nap ") | |
Thread.sleep(1000) | |
println("ohh that felt great") | |
try { | |
nofluff() | |
} catch (ex: Exception) { | |
val stackTrace = ex.getStackTrace() | |
println("catch") | |
println(stackTrace[0]) | |
println(stackTrace[1]) | |
} | |
println("Hello, world!!!") | |
typeface() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment