What if you could create objects without extra typing and confusion?
Creating instances without new keyword in Kotlin - Why You Should Know This
Imagine you want to create many objects in Kotlin, but you keep typing the new keyword like in some other languages. You try to write new Person() but Kotlin doesn't allow it.
Using new everywhere is slow and confusing because Kotlin does not use it. Trying to force it or switching between languages can cause errors and slow you down.
Kotlin lets you create objects by just calling the class name with parentheses, like Person(). This makes your code cleaner, faster to write, and easier to read.
val p = new Person()
val p = Person()
This lets you create objects quickly and clearly, making your programs easier to build and understand.
When making a contact list app, you can create each contact by just writing Contact() without extra words, so you focus on the app, not typing.
Kotlin does not use the new keyword to create objects.
You create instances by calling the class name with parentheses.
This makes your code simpler and less error-prone.