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 call-by-name? Does Scala and Java support call-by-name? What is the difference between call-by-value and call-by-name function parameters?

Answer Posted / Shivaji Choudhary

Call-by-name is a parameter passing mechanism where an argument is passed as a reference to a subroutine, allowing the subroutine to evaluate the argument only when it is actually needed (i.e., the first time the argument's value is referenced inside the subroutine). Scala supports call-by-name through its by-name parameters, while Java does not have native support for call-by-name. The main difference between call-by-value and call-by-name is that call-by-value arguments are evaluated before being passed to a function (and then the result is passed), while call-by-name arguments are only evaluated when needed within the function.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version of scala?

1


What is the current latest version of scala? What is the major change or update in scala 2.12?

7