ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the with scope function used for in Kotlin?
Correct Answer: C — Simplifies accessing properties and methods of an object
The with function helps access properties and methods of an object without repeating its reference.
val person = Person("Alice", 30)
with(person)
{
println("Name: age")
}