/* @(#)Foo.java 1.0 6 April 2003 */ /** Sample class with one integer data and one function */ public class Foo{ /** just one integer */ public int x; /** a real constructor */ public Foo(int someX){ x = someX; } /** compute a square */ public int apply(){ return x * x; } /** our standard toString() method */ public String toString(){ return("new " + this.getClass().getName() + "(" + this.x +")"); } }