2017-04-03 00:34:43 +00:00
|
|
|
|
|
|
|
|
2017-04-20 21:17:43 +00:00
|
|
|
// eigentlich sollten noch die beiden Interfaces Alpha und Gamma implementiert sein.
|
|
|
|
// warum funktioniert new i nicht?
|
|
|
|
class MyInteger {
|
|
|
|
Integer i;
|
|
|
|
MyInteger sub(MyInteger x) { return new MyInteger(x); }
|
|
|
|
MyInteger add(MyInteger x) { return new MyInteger(x); }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class A {
|
|
|
|
mt(x,y,z) { return x.sub(y).add(z); }
|
|
|
|
}
|
|
|
|
|
2017-04-04 12:52:55 +00:00
|
|
|
|
2017-04-20 21:17:43 +00:00
|
|
|
class Main {
|
|
|
|
main() { return new A<>().mt(new MyInteger(), new MyInteger() , new MyInteger() ); }
|
2017-04-03 00:34:43 +00:00
|
|
|
}
|
|
|
|
|
2017-04-20 21:17:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|