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...


What is the difference between var and val ?



What is the difference between var and val ?..

Answer / Gulwaiz Akhter

In Kotlin, both `var` and `val` are used to declare variables. The main difference lies in their mutability behavior: n1. `val`: A `val` is immutable and its value cannot be changed after it is initialized.n2. `var`: A `var` can be reassigned a new value after it is initialized.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Kotlin Interview Questions

How do you realize Ternary Conditional Operator in Kotlin ?

0 Answers  


Can Kotline offer any additional functionality for standard Java packages or standard Java classes?

1 Answers  


What is inner class in Kotlin?

1 Answers  


Where does the Kotlin run and what is the entry point of Kotlin?

1 Answers  


What kinds of programming does Kotlin support ?

1 Answers  


How to convert a String to an Int in Kotlin?

1 Answers  


What is the Elvis Operator?

1 Answers  


Define step() function in Kotlin?

1 Answers  


what is the use of extension functions in Kotlin?

1 Answers  


What is Range in Kotlin?

1 Answers  


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

1 Answers  


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

1 Answers  


Categories