VOOZH about

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

⇱ Scala Set &~() method with example - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Scala Set &~() method with example

Last Updated : 18 Oct, 2019
The &~() method is utilized to create a new set consisting of elements after the difference between two given sets.
Method Definition: def &~(that: Set[A]): Set[A] Return Type: It returns a set consisting of elements after the difference between two given sets.
Example #1:
Output:
Set(41, 72, 43)
Example #2:
Output:
Set()
Comment

Explore