I’m just trying to add these strings to a set then print them however I get this error
/MyClass.java:4: error: cannot find symbol
Set< String > set = new HashSet<>();
^
symbol: class Set
location: class MyClass
/MyClass.java:4: error: cannot find symbol
Set< String > set = new HashSet<>();
^
symbol: class HashSet
location: class MyClass
2 errors
is this all your code?
it may be better to link to a public space where we can see your full code.
(do you think you might be missing an import statement?)
I understand hash sets (or just sets?) cannot contain duplicates. Although, why in this order? Should it not be Apple, banana, cherry? Why is banana first?