How are Primary Constructors different from Secondary Constructors ?
Answer / Narendra Kumar Tiwari
Primary Constructors are the regular constructors declared in the class, and they have the same name as the class. They can contain initializer blocks to initialize properties. Secondary Constructors are declared using the constructor keyword inside another constructor and can have unique names.
| Is This Answer Correct ? | 0 Yes | 0 No |
Which method is used to get array last index?
How to declare variable in Kotlin ?
What is the use of any() function?
What is the latest version of kotlin?
What is the difference between Const and Val?
What is the type of the following Array?, val arr = arrayOf(1, 2, 3);
What are the features of java has that kotlin does not?
How to declare variables in Kotlin?
List some of the key modifiers in kotlin?
What is init block in Kotlin?
What is the Elvis Operator?
Explain the use of extension functions