VOOZH about

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

⇱ Scala Set diff() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set diff() method with example

Last Updated : 15 Oct, 2019
The diff() method is utilized to compute the difference of a set and an another set.
Method Definition: def diff(that: Set[A]): Set[A] Return Type: It returns a set which is the difference between two sets.
Example #1:
Output:
5
4
Example #2:
Output:
5
1
3
4
Comment

Explore