Vidyalelo
Computer Science · Q289

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 289

Q289

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
Answer
C.
The compiler warns of significant memory usage
D.
The code is significantly faster

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board