diff --git a/java_LL b/java_LL new file mode 100644 index 0000000..b20ce06 --- /dev/null +++ b/java_LL @@ -0,0 +1,17 @@ +import java.util.LinkedList; + +class Main { + public static void main(String[] args){ + // create linkedlist + LinkedList animals = new LinkedList<>(); + + animals.add("Dog"); + animals.add("Cat"); + animals.add("Cow"); + System.out.println("LinkedList: " + animals); + + + animals.add(1, "Horse"); + System.out.println("Updated LinkedList: " + animals); + } +}