Run ❯
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
// Import the HashSet class import java.util.HashSet; public class Main { public static void main(String[] args) { HashSet
cars = new HashSet
(); cars.add("Volvo"); cars.add("BMW"); cars.add("Ford"); cars.add("BMW"); cars.add("Mazda"); for (String i : cars) { System.out.println(i); } } }
Volvo
Mazda
Ford
BMW