javaclass

tests/ValueSubclass.java

58:7fcd2c0918c7
2004-11-15 Paul Boddie Added a test of class loading and superclass presence.
     1 public class ValueSubclass extends Value {     2     public Value tmp;     3      4     /**     5      * Test of subclass initialisation with super usage and foreign object initialisation.     6      */     7     public ValueSubclass(int x) {     8         super(x);     9         tmp = new Value(42);    10     }    11     12     /**    13      * Test of overriding.    14      */    15     public void setValue(int x) {    16         this.value = -x;    17     }    18     19     /**    20      * Test of overriding and super methods.    21      */    22     public int add(int x) {    23         return super.add(-x);    24     }    25     26     /**    27      * Test of objects as arguments.    28      */    29     public void setValueObject(Value v) {    30         this.value = v.getValue();    31     }    32 }    33     34 // This should confuse the importer since it should be read before Value in    35 // alphabetical order.    36     37 class SubclassValue extends Value {    38     public SubclassValue(int x) {    39         super(x);    40     }    41 }