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 val and var in Scala?



What is the difference between val and var in Scala?..

Answer / Prakash Kumar Rathaur

In Scala, val and var are used to declare variables. The main difference lies in their immutability: val declares a constant that cannot be reassigned, while var can be reassigned. Once assigned, the value of a val remains unchanged throughout its lifetime, whereas the value of a var may change multiple times.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What is an anonymous object in scala?

1 Answers  


What are implicit parameters in Scala?

1 Answers  


What are the advantages of case class?

1 Answers  


What is a monad in scala?

1 Answers  


Explain how scala is both functional and object-oriented programming language?

1 Answers  


What do you mean by a scala map?

1 Answers  


What is Diamond Problem? How Scala solves Diamond Problem?

1 Answers  


How many values of type Unit have in Scala?

1 Answers  


What is the default Unit and Functional Testing Framework for Play? What is the default Build Tool for Play? What is the Default Template Engine for Play? What is the built-in Web Server available in Play Framework?

1 Answers  


How many values of type Nothing have in Scala?

1 Answers  


What is a companion object?

1 Answers  


What are the popular MVC frameworks for Scala Language to develop Web Applications?

1 Answers  


Categories