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 the use of function extension ?

1 Answers  


What is the difference between Const and Val?

1 Answers  


What are some of the features which are there in Kotlin but not In Java?

1 Answers  


Is there any dependency of Secondary Constructors on Primary Constructors ?

1 Answers  


What is the difference between == and === operators in Kotlin?

0 Answers  


Does Kotlin support both Explicit conversion and Implicit conversions?

1 Answers  


How do you differentiate var and val in Kotin?

1 Answers  


What type of programming does Kotlin support?

1 Answers  


How do you declare a variable as volatile in Kotlin ?

1 Answers  


List the number of constructors available in Kotlin?

1 Answers  


What are the features that kotlin support and java doesn’t?

1 Answers  


Can you migrate the code from java to kotlin?

1 Answers  


Categories