Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Add Numbers (convert string to int)

  • toInt
object AddNumbers {
    def main(args:Array[String]) {
        val first:Int = args(0).toInt
        val second:Int = args(1).toInt
        println(first + second)
    }
}