Can you modify the elements of an immutable list in Kotlin?
Yes
No
How do you call a method named 'myMethod' on an object 'myObject' in Kotlin?
call(myObject, myMethod)
myMethod(myObject)
myObject.myMethod()
myObject->myMethod()
How can you check if a value is within a range in Kotlin?
Using the 'in' operator
Both 'in' operator and 'contains' method can be used
None of the above
Using the 'contains' method
Which keyword is used to declare a class in Kotlin?
struct
interface
object
class
How do you use a named argument when calling a function in Kotlin?
By specifying the argument name followed by '=' and the value inside the function call.
Named arguments are not supported in Kotlin.
By simply passing the values in the correct order.
By using the '->' symbol followed by the argument name and value.
Which data type represents a whole number in Kotlin?
Float
String
Boolean
Int
Which method adds an element to a mutable list in Kotlin?
add()
append()
put()
insert()
What is the purpose of single-line comments in Kotlin?
To declare variables
To define code blocks
To add explanations or disable code temporarily
To import external libraries
What is the difference between emptyList() and mutableListOf() in Kotlin?
emptyList()
mutableListOf()
emptyList() creates a list with a fixed size, while mutableListOf() creates a list with dynamic size.
emptyList() creates an empty immutable list, while mutableListOf() creates an empty mutable list.
emptyList() is used for numbers, while mutableListOf() is used for strings.
There is no difference; both are interchangeable.
Which method adds an element to the end of a mutable list in Kotlin?
push()