Java program to delete a new node from the end of the doubly linked list
In this program, we will create a doubly linked list and delete a node from the end of the list. If the list is empty, print the message "List is empty". If the list is not empty, tail's previous node will become the new tail of the list thus, deleting the last node from the list.
In above example, node new was the tail of the list. Make tail's previous node that is, node 4 as the tail of the list. Node 4's next will point to null.
a. display() will show all the nodes present in the list.
Original List: 1 2 3 4 5 Updated List: 1 2 3 4 Updated List: 1 2 3 Updated List: 1 2 Updated List: 1 Updated List: List is empty