You have a function simple() that is called frequently in your code. You place the inline prefix on the function. What effect does it have on the code?
inline fun simple(x: Int): Int{
return x * x
}
fun main() {
for(count in 1..1000) {
simple(count)
}
}
inline fun simple(x: Int): Int{
return x * x
}
fun main() {
for(count in 1..1000) {
simple(count)
}
}A. The code will give a stack overflow error
B. The compiler warns of insignificant performance impact
C. The compiler warns of significant memory usage
D. The code is significantly faster
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