Preview:
import java.util.LinkedList;

class D {
    public static void main(String[] args) {
        LinkedList<String> name = new LinkedList<String>();

        name.addFirst("harry");
        System.out.println(name);
        name.addLast("om");
        System.out.println(name);
        name.add(2, "pop");
        System.out.println(name);
        name.remove();
        System.out.println(name);
        
        name.add(2, "elementAt2");
        System.out.println(name);
    }
}
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