페이지

2015년 10월 22일 목요일

Scala2e Chapter2 First Steps in Scala - Step4. Write some Scala scripts

Step4. Write some Scala scripts

A script is just a sequence of statements in a file that will be executed sequentially.

Put this into a file named hello.scala:

println("Hello, world, from a script!")

$ scala hello.scala

Hello, world, from a script!

To try this out, type the following into a new file named helloarg.scala
// Say hello to the first argument

println("Hello, "+ args(0) +"!")

$ scala helloarg.scala planet

Hello, planet!


댓글 없음: