...
| Code Block |
|---|
class Complex {
def re, im
Complex (double real, double imaginary) {
re = real
im = imaginary
}
String toString() { "$re" + (imim<0 ? "+${im}i"'' : ""'+') + im + 'i' }
}
|
but in other cases you may have some existing scala classes you wish to reuse from Groovy.