class LinkedList implements List { private InnerList content; private LinkedList(InnerList L) { content=L; } public Object head() { return content.first; } public List tail() { return new LinkedList(content.next); } public List cons(Object h) { return new LinkedList(new InnerList(h,content)); } public static List empty() { return new LinkedList(null); } public boolean isempty() { return (content==null); } private static class InnerList { Object first; InnerList next; InnerList(Object hd,InnerList tl) { first=hd; next=tl; } } }