Groovy 參考語法

Object Computing, Inc. – Java News Brief – February 2004

switch (x) { case ‘Mark’: println “got my name" break case 3..7: println ‘got a number in the range 3 to 7 inclusive’ break case [‘Moe’, ‘Larry’, ‘Curly’]: println ‘got a Stooge name’ break case java.util.Date: println ‘got a Date object’ break case ~"\\d{5}": println ‘got a zip code’ break default: println “got unexpected value ${x}" }

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 5 + 5 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)