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 the role of open keyword in Kotlin?

1 Answers  


How to declare a variable in kotlin?

1 Answers  


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

1 Answers  


How many constructors are available in Kotlin?

1 Answers  


What is Data Class in Kotlin?

1 Answers  


How to make a class data class ?

1 Answers  


What is the difference between var and val ?

1 Answers  


What is the difference between declaration variable using val or var in kotlin?

1 Answers  


How to convert a String to an Integer?

1 Answers  


What is the type of arguments inside a constructor?

1 Answers  


Why you should switch to Kotlin from Java?

1 Answers  


When instruction in Kotlin are executed ?

1 Answers  


Categories