VOOZH about

URL: https://www.geeksforgeeks.org/scala/scala-set-exists-method-with-example/

⇱ Scala Set exists() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set exists() method with example

Last Updated : 18 Oct, 2019
The exists() method is utilized to test whether a predicate holds for some of the elements of the set or not.
Method Definition: def exists(p: (A) => Boolean): Boolean Return Type: It returns true if the stated predicate holds true for some elements of the set else it returns false.
Example #1:
Output:
true
Example #2:
Output:
false
Comment

Explore