Examveda

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)
  }
}

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


This Question Belongs to Computer Science >> Kotlin Program

Join The Discussion

Related Questions on Kotlin Program

What is Kotlin?

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.