Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
package Collection;
import java.util.*;
public class HashSetDemo {
public static void main(String args[]){
Set<String> set = new HashSet<>();
set.add("Niğde");
set.add("Eskişehir");
set.add("Ankara");
set.add("İstanbul");
set.add("Kayseri");
set.add("Niğde"); // Duplicate;
for(String s : set){
System.out.print(s.toUpperCase() +" ");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment