Implement a method that returns a Set of all of the unique letters (including spaces) in a
Question:
Implement a method that returns a Set of all of the unique letters (including spaces) in a String. Letters are returned as strings with length 1. Call this method: makeSet
a. Parameter(s): a String b. Returns: a Set c. Ex. Input: "COMP 271 and sets". Output: [" ", "1", "2", "7", "C", "M", "O", "P",
"a", "d", "e", "n", "s", "t"]. The space is in the first position. You then have the digits and characters in sequential order.
Finish the code below:
Main Method:
import java.util.*; class Main { public static void main(String[] args) { System.out.println("Hello world!"); String x = "COMP 271 and sets"; System.out.println(makeSet(x)); }
//Add your code here
}
Resources:
1. https://www.youtube.com/watch?v=_aEks9LECaU
2. https://www.youtube.com/watch?v=At_HaClrey0
3. https://www.youtube.com/watch?v=WcKI8XdtZfo