Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
It allows the function to be called using infix notation
It allows the function to be inlined at the call site to improve performance
It allows the function to be called with or without argument names
It allows the function to be called with a variable number of arguments
fun sum(vararg nums: Int): Int = nums.sum()
fun sum(nums: Array): Int = nums.sum()
fun sum(nums: List): Int = nums.sum()
fun sum(nums: Set): Int = nums.sum()
It prevents the use of non-local returns in the function body
A function that returns a value
A function that takes another function as a parameter or returns a function as a result
A function that has a variable number of arguments
A function that can be called without any arguments
Int
Unit
Void
None
fun noArgs()
fun noArgs(): Unit
fun noArgs(): Void
fun noArgs(): Nothing
add(1, 2)
add(x = 1, y = 2)
add(y = 2, x = 1)
x.add(2)
It allows the function to be called using tail recursion optimization
It allows the function to be used as an overloaded operator
It allows the function to be called using prefix notation