Scala Statement
Jump to navigation
Jump to search
A Scala Statement is a Scala code item that is a software expression.
- Context:
- It can (typically) be an Imperative Program Expression.
- ...
- Example(s):
// a one-line comment
2 * 3.45 + 6 ;
, a Mathematical Operation.println("Result=", 2 * 3.45 + 6) ;
, an STDOUT Print Statement.val engToDeu = Map(("dog","Hund"), ("cat","Katze"), ("rhinoceros","Nashorn")) ;
, a Scala Map variable definition statement.do { println(x); x += 1} while (x < 5)
, a Loop Statement.def f(x: Any) = { println(x) }
, a Function Definition Statement with anonymous type.def intRoot23(num: Int) = {
val numSquare = num*num
(cbrt(numSquare) + log(numSquare)).toInt}- ...
- Counter-Example(s):
- See: Scala Source Code, Scala Program.
References
2010
- (Odersky et al., 2010) ⇒ Martin Odersky, Lex Spoon, and Bill Venners. (2010). “Programming in Scala, 2nd edition." Artima. ISBN:0981531644