Both const and @JvmField create constants. What can const do that @JvmField cannot?
class Detail {
companion object {
const val COLOR = "Blue"
@JvmField val SIZE = "Really Big"
}
}
class Detail {
companion object {
const val COLOR = "Blue"
@JvmField val SIZE = "Really Big"
}
}A. const is compatible with Java, but @JvmField is not
B. The compiler will inline const so it is faster and more memory efficient
C. Virtually any type can be used with const but not @JvmField
D. const can also be used with mutable types
Answer: Option B
Related Questions on Kotlin Program
A. A new version of Java.
B. A JavaScript framework.
C. A statically-typed programming language for the JVM, Android, and browser.
D. A database management system.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP

Join The Discussion