public class ElvisJoke {
public static void main(String[] args) {
ElvisJoke haha = new ElvisJoke();
TNode theBuilding = haha.new TNode();
TNode elvis = haha.new TNode(theBuilding,null,"Elvis");
if (elvis.hasLeft(theBuilding)){
System.out.println("Thank you very much!");
}
}
private class TNode {
TNode left;
TNode right;
String data;
TNode(){
this(null,null,"No Data");
}
TNode(TNode left, TNode right, String data){
this.left = left;
this.right = right;
this.data = data;
}
boolean hasLeft(TNode node){
return (left!=null);
}
boolean hasRight(TNode node){
return (right!=null);
}
String getData() {
return this.data;
}
}
}
Archive for April, 2007
ElvisJoke
Apr 1