<<< Common methods of the LinkedList class | Index | Code that adds elements to the beginning and end of the list >>> |
// create a linked list of type String LinkedList<String> codes = new LinkedList<>(); // add three strings codes.add("mbdk"); codes.add("citr"); codes.add(0, "warp"); System.out.println(codes);
Resulting output
[warp, mbdk, citr]
<<< Common methods of the LinkedList class | Index | Code that adds elements to the beginning and end of the list >>> |