From 5b0b249bb48bdcca4b36ca69063ea01e4c604d76 Mon Sep 17 00:00:00 2001 From: windowsinsiders <72295318+windowsinsiders@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:01:59 +0530 Subject: [PATCH] arraylist-pro-max A more refined and easy to understand version of the program. --- arraylist-pro-max | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 arraylist-pro-max diff --git a/arraylist-pro-max b/arraylist-pro-max new file mode 100644 index 0000000..792b26e --- /dev/null +++ b/arraylist-pro-max @@ -0,0 +1,28 @@ +import java.util.*; + +public class Test { + + public static void main(String args[]) + { + // Creating object of the + // class linked list + LinkedList ll + = new LinkedList(); + + // Adding elements to the linked list + ll.add("A"); + ll.add("B"); + ll.addLast("C"); + ll.addFirst("D"); + ll.add(2, "E"); + + System.out.println(ll); + + ll.remove("B"); + ll.remove(3); + ll.removeFirst(); + ll.removeLast(); + + System.out.println(ll); + } +}