import com.doubleLinkedList.Node; public class ReverseList { public Node ReverseList1(Node head){ Node current=head; Node prevnode=null; Node newhead=null; if(current==null){ throw new NullPointerException("no node this listnode!"); } while(current!=null){ Node nextnode=current.next; current.next=prevnode; if(nextnode==null){ newhead=current; } prevnode=current; current=nextnode; } return newhead; } }