1.1 --- a/tests/ValueSubclass.java Wed Nov 10 17:47:04 2004 +0100
1.2 +++ b/tests/ValueSubclass.java Thu Nov 11 15:24:21 2004 +0100
1.3 @@ -1,6 +1,31 @@
1.4 public class ValueSubclass extends Value {
1.5
1.6 + /**
1.7 + * Test of subclass initialisation with super usage and foreign object initialisation.
1.8 + */
1.9 public ValueSubclass(int x) {
1.10 super(x);
1.11 + Value tmp = new Value(42);
1.12 + }
1.13 +
1.14 + /**
1.15 + * Test of overriding.
1.16 + */
1.17 + public void setValue(int x) {
1.18 + this.value = -x;
1.19 + }
1.20 +
1.21 + /**
1.22 + * Test of overriding and super methods.
1.23 + */
1.24 + public int add(int x) {
1.25 + return super.add(-x);
1.26 + }
1.27 +
1.28 + /**
1.29 + * Test of objects as arguments.
1.30 + */
1.31 + public void setValueObject(Value v) {
1.32 + this.value = v.getValue();
1.33 }
1.34 }