Complete the code to create an instance of the class without using the 'new' keyword.
class Person(val name: String) val person = [1]("Alice")
In Kotlin, you create instances by calling the class name like a function, without using the 'new' keyword.
Complete the code to instantiate the data class without 'new'.
data class Car(val model: String, val year: Int) val car = [1]("Toyota", 2020)
In Kotlin, you create an instance by calling the class name with arguments directly, no 'new' keyword needed.
Fix the error by completing the code to create an instance of the class without 'new'.
class Book(val title: String) val book = [1]("Kotlin Guide")
Kotlin creates instances by calling the class name with parameters directly, no 'new' keyword.
Fill both blanks to create an instance of the class without 'new' and access its property.
class User(val username: String) val user = [1]("john_doe") println(user.[2])
Create the instance by calling the class name directly and access the property by its correct name.
Fill all three blanks to create an instance, call a method, and print the result without using 'new'.
class Calculator { fun add(a: Int, b: Int): Int = a + b } val calc = [1]() val sum = calc.[2](5, 7) println([3])
Create the instance by calling the class name directly, call the method by its name, and print the variable holding the result.