아래의 Groovy 언어 용으로 작성된 소스를 Scala 언어 용으로 고친 것이다. Scala 언어에서 주석문(// 및 /* ... */), while 반복문은 Java 언어의 것과 동일하다. var 은 변수를 선언할 때 붙이는 Scala 예약어이고, 배열이나 리스트의 한 요소를 가져오는 Scala 구문은 array(index), list(index) 이다. (Groovy 언어의 구문 array[index], list[index] 과 비교하기 바란다.) 소스 파일명: testWhile.scala /* * Filename: testWhile.scala * * Purpose: Example using the while loop syntax * while .... * * Execute: scala testWh..