Scala Tutorials
- Basic Scala Tutorial
About
Tweet
9
Method definition
In Scala methods are defined using
def
Methods that return a value must have an equal sign before the body of the method
Methods that have either a return statement or are recursive must declare a return type
def add(x:Int, y:Int):Int = { return x + y } 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