KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > scm > Selfrep


1 package scm;
2
3 class Selfrep implements Obj
4 { String JavaDoc val; double num;
5   public Obj eval(Env e) { return this; }
6
7   Selfrep(double num)
8   { super(); this.num = num; val = null; }
9   Selfrep(String JavaDoc s)
10   { super(); val = s; }
11
12   public String JavaDoc toString()
13   {
14     if (val == null)
15       return ("Number: " + num);
16     return ("String: " + val);
17   }
18 }
19
Popular Tags