public static void main(String[] args) {
LinkedList l1 = new LinkedList();
LinkedList l2 = new LinkedList();
l1.display();
l1.append(2);
l1.append(4);
l1.append(3);
l1.display();
System.out.println();
l2.append(5);
l2.append(6);
l2.append(4);
l2.display();
System.out.println();
LinkedList l3 = addtwoLinkedList(l1, l2);
l3.display();
}
}This will print
Empty
2 -> 4 -> 3 ->
5 -> 6 -> 4 ->
7 -> 0 -> 8 ->