Hi Mr. Ernest, Thank you for answering my question. I forgot to send the rest of the code. Here they are. public class List {
private int element; private List next; public List() {
element = 0; next = null; } public List(int elem, List nextElem) { element = elem; next = nextElem; } public void setElem(int someElement) { element = someElement; } public void setNext(List newNext) { next = newNext; } public int getElem() { return element; } public List getNext() { return next; } } public class io { public io() { }
static String readString() { int ch; String r = ""; boolean done = false; while (!done) { try { ch = System.in.read(); if (ch < 0 | | (char)ch == '\n') done = true; else if ((char)ch != '\r') r = r + (char) ch; } catch(java.io.IOException e) { done = true; } } return r; }