import java.util.ArrayList; import java.util.Collections; import java.util.List; public class ListsDemo { public static void main(String[] args) { List<String> koelPages = new ArrayList<>(); koelPages.add("LoginPage"); koelPages.set(0, "RegistrationPage"); koelPages.add("HomePage"); koelPages.add("ProfilePage"); koelPages.add("APage"); koelPages.add("ZPage"); Collections.sort(koelPages); Collections.reverse(koelPages); for(String i: koelPages) { System.out.println(koelPages); } }
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