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 guard in Scala’s for-comprehension construct?



What is guard in Scala’s for-comprehension construct?..

Answer / Loma Patwa

In Scala, a 'guard' is a condition that can be used within a for-comprehension construct to filter the elements of an iterator or collection. The syntax for using a guard is: GuardedFor((expr) if (condition) yield result). It returns only those elements for which the condition evaluates to true.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What is an object in scala?

1 Answers  


What is the function parameter with a default value in scala?

1 Answers  


What is the best Scala style checker tool available for Play and Scala based applications?

1 Answers  


In Scala, Pattern Matching follows which Design Pattern? In Java, ‘isinstanceof’ operator follows which Design Pattern?

1 Answers  


Give some examples of packages in scala?

1 Answers  


What is for-comprehension in scala?

1 Answers  


What do you mean by foldleft in scala?

1 Answers  


What do you mean by scala map?

1 Answers  


What is scala best used for?

1 Answers  


How is a class different from an object?

1 Answers  


Explain que?

1 Answers  


Compare to java what are the major advantages or benefits of scala?

1 Answers  


Categories