To check whether an item exists in a HashSet, use the contains()
method:
Example
cars.contains("Mazda");
Practice Excercise Practice now
To check whether an item exists in a HashSet, use the contains()
method:
cars.contains("Mazda");
Practice Excercise Practice now