VOOZH about

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

⇱ Scala Set contains() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set contains() method with example

Last Updated : 18 Oct, 2019
The contains() method is utilized to check if an element is present in the set of not.
Method Definition: def contains(elem: A): Boolean Return Type: It returns true if the element is present in the set else it returns false.
Example #1:
Output:
true
Example #2:
Output:
false
Comment

Explore