Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (true) {
- def key = 'x'
- def map = [key: 'treasure']
- def val = map.get(key)
- println val
- }
- if (true) {
- def map = [2: 'treasure']
- def key = 2
- def val = map."$key"
- println val
- }
- if (true) {
- List<Long> list = [1,2,3]
- def now = new Date()
- list << now
- println list
- println list*.class.name
- }
- if (true) {
- def map = [metaClass: "Frequency"]
- println "What's the $map.metaClass, dude?"
- }
- def static hello(n) {
- ['9': "Hell${n}, Alex!"]
- }
- def result = hello 09
- println result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement