Read the code carefully before you run it.
// File: Utils.kt
package de.firma.tools
fun square(x: Int): Int = x * x
class Calculator {
fun double(x: Int): Int = x * 2
}
How many .class files does the Kotlin compiler produce from this one Utils.kt, and what are they called?
AppConfig.kt contains only top-level declarations. Java code currently has to call them through AppConfigKt.loadConfiguration() — after all, the generated class is named after the file plus "Kt". Use a file annotation to make the generated class be called AppConfig instead, without renaming the file or moving the code into a real class.
Before you get a hint: what have you tried, and where exactly are you stuck?
1. Why can Java code call Kotlin top-level functions at all, although the JVM knows no "free" functions outside classes?
2. What does the JIT compiler (Just-in-Time) do when the JVM recognizes a method as "hot" (executed often)?
3. A file Utils.kt contains a top-level function square() AND a class Calculator. How many .class files does the Kotlin compiler produce from that, and what are they called?