Created
January 17, 2017 19:58
-
-
Save bowbahdoe/38e332f6163c8f0eab178b408343cb25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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