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 to make a class data class ?



How to make a class data class ?..

Answer / Rajendra Singh Rana

To create a data class in Kotlin, you should use the 'data' keyword followed by the class name and any required properties. For example: data class Person(val name: String, val age: Int). Data classes automatically generate equals(), hashCode(), toString(), and copy() methods.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Kotlin Interview Questions

What is Ranges operator in Kotlin?

1 Answers  


What is companion object?

1 Answers  


List the Basic data types of Kotlin?

1 Answers  


Does Kotlin support primitive Datatypes?

1 Answers  


What is the role of matches() method in regular expression?

1 Answers  


How is a function declared? Why are Kotlin functions known as top-level functions?

0 Answers  


What type of programming does Kotlin support?

1 Answers  


Describe the use of extension function?

1 Answers  


Can you migrate the code from java to kotlin? If yes how do you do it?

1 Answers  


How can you declare a variable in Kotlin?

1 Answers  


What are the disadvantages of kotlin?

1 Answers  


Why developers can prefer kotlin over java?

1 Answers  


Categories