사용자 도구

사이트 도구


groovy:제어문

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
groovy:제어문 [2013/05/17 14:50]
kwon37xi [Groovy 제어문]
groovy:제어문 [2013/05/17 14:50]
kwon37xi [for]
줄 8: 줄 8:
   * Index가 필요한 for 문은 ''list.eachWithIndex { obj, idx -> 처리문... }'' 형태로 만들면 된다.<code groovy>   * Index가 필요한 for 문은 ''list.eachWithIndex { obj, idx -> 처리문... }'' 형태로 만들면 된다.<code groovy>
 def stringList = [ "java", "perl", "python", "ruby", "c#", "cobol", def stringList = [ "java", "perl", "python", "ruby", "c#", "cobol",
-                   "groovy", "jython", "smalltalk", "prolog", "m", "yacc" ]; +                   "groovy", "jython", "smalltalk", "prolog", "m", "yacc" ] 
-stringList.eachWithIndex() { obj, i -> println " ${i}: ${obj}" };+ 
 +stringList.eachWithIndex() { obj, i -> println " ${i}: ${obj}" }
 </code> </code>
 ===== switch/case ===== ===== switch/case =====
groovy/제어문.txt · 마지막으로 수정됨: 2013/05/17 14:50 저자 kwon37xi