VOOZH about

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

⇱ 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 all elements that are present in both the given sets.
Method Definition: Return Type: It returns a new set consisting of all elements that are present in both the given sets.
Example #1:
Output:
Set(1, 12, 23)
Example #2:
Output:
Set()
Comment

Explore