Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How many types of constructors are there ? What are they ?



How many types of constructors are there ? What are they ?..

Answer / Mohit Kumar Sharma

In Kotlin, there are two types of constructors: Primary Constructors and Secondary Constructors. A Primary Constructor is a constructor that is declared in the class declaration itself and has the same name as the class. Secondary Constructors are declared inside the primary constructor with the help of init blocks or by using constructor keyword. They can have different names but must call the primary constructor.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Kotlin Interview Questions

What is companion object?

1 Answers  


Can you migrate the code from java to kotlin?

1 Answers  


In kotlin, can we create an empty array?

1 Answers  


What are the major features of Kotlin?

1 Answers  


What is the extension of Kotlin file?

1 Answers  


How can you handle null exceptions in Kotlin?

1 Answers  


What are the modifier available in Kotlin ?

1 Answers  


Give example to declare variable using both val and var in Kotlin?

1 Answers  


Explain the Main features of kotlin which are not available in java?

1 Answers  


What is the default visibility modifier and also list the different types of modifiers?

1 Answers  


How are Primary Constructors different from Secondary Constructors ?

1 Answers  


Give me name of the extension methods Kotlin provides to java.io.File

1 Answers  


Categories