-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearn.groovy
49 lines (28 loc) · 799 Bytes
/
learn.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
println "Hello World!"
def x = 1
println x
x = new java.util.Date()
println x
x = -3.1499392
println x
x = false
println x
x = "Groovy!"
println x
def technologies = []
technologies.add('Grails!')
technologies << 'Groovy'
technologies.addAll(['Griffon','Gradle'])
technologies.remove('Griffon')
technologies = technologies - 'Grails!'
technologies.each {println "Technology: $it"}
technologies.eachWithIndex {it, i -> println "$i: $it"}
contained = technologies.contains('Groovy')
contained = 'Gradle' in technologies
technologies.containsAll(['Gradle','Groovy'])
//technologies.sort()
sortedTechnologies = technologies.sort(false)
Collections.replaceAll(technologies,'Gradle','gradle')
technologies << 'test'
Collections.shuffle(technologies, new Random())
println technologies