2024-06-07 22:06:00 +02:00
|
|
|
def words = ["Groovy", "ist", "cool"]
|
2024-06-10 19:01:29 +02:00
|
|
|
def numbers = [1, 2, 3, 4, 5]
|
|
|
|
|
2024-06-07 22:06:00 +02:00
|
|
|
def lengths = words*.length()
|
|
|
|
def squares = numbers*.multiply(numbers)
|
|
|
|
|
|
|
|
println("Längen: $lengths") // Erwartete Ausgabe: Längen: [6, 3, 4]
|
|
|
|
println("Quadrate: $squares") // Erwartete Ausgabe: Quadrate: [1, 4, 9, 16, 25]
|