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 'lazy val' in Scala? What is Eager Evaluation? What is Lazy Evaluation?



What is the difference between 'val' and 'lazy val' in Scala? What is Eager Eval..

Answer / Amit Singh Bisht

In Scala, 'val' is a value that is initialized when it is defined. This process is known as Eager Evaluation. On the other hand, 'lazy val' initializes the value only when it is first accessed or needed. This is called Lazy Evaluation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

Is scala good for data science?

1 Answers  


What is an abstract class in scala?

1 Answers  


What is the difference between call-by-value and call-by-name function parameters?

1 Answers  


Explain the use of tuples in scala?

1 Answers  


What is akka in scala?

1 Answers  


Why is scala faster than java?

1 Answers  


What is the difference between :: and #:: in Scala? What is the difference between ::: and #::: in Scala?

1 Answers  


What are higher-order functions in scala?

1 Answers  


What is a function literal in scala?

1 Answers  


What do you mean by option in scala and why it is used?

1 Answers  


What is a flatmap in scala?

1 Answers  


What is method overloading in scala?

1 Answers  


Categories