package com.example;
@SuppressWarnings("all")
public class Test {
protected int wrapped;
public Test(final int value) {
this.wrapped = value;
}
public int operator_plus(final Test e2) {
return (this.wrapped + e2.wrapped);
}
}
package com.example
class Test2 {
new() {
val t1 = new Test(3)
val t2 = new Test(5)
val t3 = t1 + t2
}
}
//plus() => for the + operator
//multiply() => for the * operator
//leftShift() = for the << operator
// ... and so on ...
class Fish {
def leftShift(Fish fish) {
print "You just << (left shifted) some fish "
}
}
def fish = new Fish()
def fish2 = new Fish()
fish << fish2