class CharListD implements CharList { private InnerList content; private CharListD(InnerList L) { content=L; } public char head() { return content.first; } public CharList tail() { return new CharListD(content.next); } public CharList cons(char ch) { return new CharListD(new InnerList(ch,content)); } public static CharList empty() { return new CharListD(null); } public boolean isempty() { return (content==null); } private static class InnerList { char first; InnerList next; InnerList(char hd,InnerList tl) { first=hd; next=tl; } } }