Sets donít allows duplicate values. Consider the example below:

Java Code:
		Set set = new HashSet();
		set.add("Cricket");
		set.add("Football");
		set.add("Cricket");
		set.add("Rugby");
		set.add("Cricket");
		System.out.println(set);
Output:

Java Code:
[Rugby, Cricket, Football]