what's wrong with deleteAll method for single linked list? I want to delete all nodes in the list. Can't figure out what's wrong with this : 
    public void deleteAll() {
		if(head==null) {
			System.out.println("list already empty");
		}
		else {
			Node temp=head; Node del;
			while(temp.next!=null) {
				del=temp.next;
				temp=null;
				temp=del;
			}
			System.out.println("all nodes deleted");
		}
	}
this is  the method to delete all nodes in linked list without taking parameters.