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