Scala Tutorials
- Basic Scala Tutorial
About
Tweet
10
Method definition 2
return
keyword is optional
Return type is inferred (for non recursive methods and methods that don’t have an explicit
return
value)
def add(x:Int, y:Int) = { //result type is inferred x + y //"return" keyword is optional } println(add(42,13))
Theme
Monokai
Solarized Dark
Eclipse
Code editor is using
Scalakata.com
written by
Guillaume Massé
TOC
◀ Prev
Next ▶
×
Table of Contents