Ileyan Al Jaaf 2024-05-30 19:34:08 +02:00
commit 80d9b31e2b
27 changed files with 41 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
.DS_Store

View File

@ -1,3 +1,41 @@
### Enums
Enums sind gleich wie in Java
```Groovy
enum Day{
MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
}
Day today = Day.MONDAY
```
Man kann in Enums zusätzlich noch Eigenschaften und Methoden einbauen
```Groovy
enum Day{
MONDAY("First Day of the Week"),
TUESDAY("Second Day of the Week),
//...
final String description
Day(String description){
this.description = description
}
String getDescription(){
return description
}
}
Day today = Day.FRIDAY
def description = today.getDescription
println("Today is $today: $description")
```
Zusätzlich dazu kann man auch Methoden überschreiben (z.B. toString()-Methode)
### Ranges
Ähnlich wie in Ruby, jedoch nicht gleich
```Groovy
@ -109,3 +147,5 @@ Entfernen eines Elements:
```Groovy
mySet.remove(1)
println mySet // [2,3,4,5,6,7]
```

BIN
yuliya/groovy.pptx 100644

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB