@@ -0,0 +1,1729 @@
+package iProlog;%0Aclass IntList %7B%0A%0A final int head;%0A  final IntList tail;%0A%0A  private IntList(final int head) %7B%0A    this.head = head;%0A    tail = null;%0A  %7D%0A%0A  private IntList(final int X, final IntList Xs) %7B%0A    head = X;%0A    tail = Xs;%0A  %7D%0A%0A  static final boolean isEmpty(final IntList Xs) %7B%0A    return null == Xs;%0A  %7D%0A%0A  static final int head(final IntList Xs) %7B%0A    return Xs.head;%0A  %7D%0A%0A  static final IntList empty = null;%0A%0A  static final IntList tail(final IntList Xs) %7B%0A    return Xs.tail;%0A  %7D%0A%0A  static final IntList cons(final int X, final IntList Xs) %7B%0A    return new IntList(X, Xs);%0A  %7D%0A%0A  static final IntList app(final int%5B%5D xs, final IntList Ys) %7B%0A    IntList Zs = Ys;%0A    for (int i = xs.length - 1; i %3E= 0; i--) %7B%0A      Zs = cons(xs%5Bi%5D, Zs);%0A    %7D%0A    return Zs;%0A  %7D%0A%0A  static final IntStack toInts(IntList Xs) %7B%0A    final IntStack is = new IntStack();%0A    while (!isEmpty(Xs)) %7B%0A      is.push(head(Xs));%0A      Xs = tail(Xs);%0A    %7D%0A    return is;%0A  %7D%0A%0A  static final int len(final IntList Xs) %7B%0A    return toInts(Xs).size();%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return toInts(this).toString();%0A  %7D%0A  %0A%0A  %0A  %0A public static void main(String args%5B%5D)%7B%0A%0A%09  IntList headEle = new IntList(50);%0A%09  IntList curList = new IntList(100, headEle);%0A%09  System.out.println(%22Elements are: %22+ curList.toString());%0A%09  System.out.println(%22**********LIST************* %5Cn%5Cn%22);%0A%09  System.out.println(%22Head : %22+ IntList.head(curList));%0A%09  System.out.println(%22Tail : %22+ IntList.tail(curList));%0A%09  System.out.println(%22Length  %22+ IntList.len(curList));%0A%09  System.out.println(%22Added List using cons %22 + IntList.cons(70, curList));%0A%09  System.out.println(%22List by adding arrays: %22+ IntList.app(new int%5B%5D%7B10,20,30%7D, curList));%0A%0A %0A%7D%0A%7D%0A

Create IntList.java