VOOZH about

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

⇱ Scala Set count() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set count() method with example

Last Updated : 15 Oct, 2019
The count() method is utilized to count the number of elements in the set.
Method Definition: def count(p: (A) => Boolean): Int Return Type: It returns the number of elements present in the set.
Example #1:
Output:
5
Example #2:
Output:
0
Comment

Explore