Skip to content

Instantly share code, notes, and snippets.

@bowbahdoe
Created January 17, 2017 19:58
Show Gist options
  • Save bowbahdoe/38e332f6163c8f0eab178b408343cb25 to your computer and use it in GitHub Desktop.
Save bowbahdoe/38e332f6163c8f0eab178b408343cb25 to your computer and use it in GitHub Desktop.
interface ILO {}
class LO<T> implements ILO {
boolean empty;
T first;
LO<T> rest;
// Creates an ILO
LO(T first, LO<T> rest) {
this.first = first;
this.rest = rest;
this.empty = false;
}
// Creates an empty ILO
LO() {
this.first = null;
this.rest = null;
this.empty = true;
}
public boolean isEmpty() {
return this.empty;
}
T getFirst() {
return this.first;
}
LO<T> getRest() {
return this.rest;
}
}
class LOPet extends LO<IPet>{
LOPet() {
super();
}
LOPet(IPet a, LOPet b) {
super(a, b);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment