import java.util.Set; import java.util.TreeSet; public class Main { public static void main(String[] args) { Set<String> uniqueKoelPages = new TreeSet<>(); uniqueKoelPages.add("LoginPage"); uniqueKoelPages.add("HomePage"); uniqueKoelPages.add("HomePage"); uniqueKoelPages.add("ProfilePage"); uniqueKoelPages.add("AProfilePage"); System.out.println(uniqueKoelPages); } } // Output: [AProfilePage, HomePage, LoginPage, ProfilePage]
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter