Q:

Deleting all elements from a Linked List

So I'm trying to delete all my elements in my linked list, so far I can delete certain elements and delete elements at the tail of the list. How would I go about deleting all elements in the list? I'm going to point out that we're not allowed to use the built in methods for linked lists in java already
import java.util.*;
class Node{
    //node class
    char data;
    Node next;
    public Node(Character ch){
        data = ch; next = null;
    }
    public Node next(){return next;}
    public void setNext(Node p){
        next = p;
    }
    public void set(Character ch){data = ch;}
    public int data(){return data;}
}
class Reader{
        Node head = null; Node tail = null;
        public void add(Character ch){          
        Node nw = new Node(ch);
        if(head == null){
            head = nw; tail = nw;
        }
        else{
            tail.setNext(nw);
            tail = nw;
        }
        }       
        public void display(){
            //display characters
            Node k = head; 
            System.out.print('[');
            while(k!=null){
                if(k.next!=null)
                    System.out.print((char)k.data()); 
                else
                    System.out.print((char)k.data());
                k=k.next(); 
            }   
            System.out.print(']'); 
        } 

         public void del(){
             Node k = head;
                if (tail == null)
                      return;
                else {
                      if (head == tail) {
                            head = null;
                            tail = null;
                      } else {
                            while (k.next != tail)
                                 k = k.next;
                            tail = k;
                            tail.next = null;
                      }
                }
          }

        public void delLine(){
                //delete current line

              }
    }

class assignment9{
    public static void main(String[]args){
        Scanner in = new Scanner(System.in); 
        Reader r1 =  new Reader();
        System.out.println("Enter characters");
        r1.add(in.next().charAt(0));r1.add(in.next().charAt(0));r1.add(in.next().charAt(0));r1.add(in.next().charAt(0));r1.add(in.next().charAt(0));                

    }
}

A:

Just do:  
public void deleteAll(){  
   head = tail = null;  
}

GC will take care of the rest

