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?



What is call-by-name? Does Scala and Java support call-by-name? What is the difference between call-..

Answer / 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

More Scala Interview Questions

What is a function literal in scala?

1 Answers  


Tell the advantages of companion objects when used in scala?

1 Answers  


Why is an option used in scala?

1 Answers  


What is a closure?

1 Answers  


What is a flatmap in scala?

1 Answers  


What is the difference between a java future and a scala future?

1 Answers  


What is Case Classes?

1 Answers  


What is vector in scala collection?

1 Answers  


What is the main motto of Scala Language?

1 Answers  


What is throw in scala?

1 Answers  


What is an ofdim method in scala?

1 Answers  


Difference between Scala’s Inner class and Java’s Inner class?

1 Answers  


Categories