Step3. Define some functions
scala> def max(x: Int, y: Int): Int = {
if (x > y) x
else y
}
max: (x: Int,y: Int)Int
scala> max(3, 5)
res4: Int = 5
scala> def greet() = println("Hello, world!")
greet: ()Unit
Scala’s Unit type is similar to Java’s void type
댓글 없음:
댓글 쓰기