Browse - Programming Tips - How do I declare a function that returns nothing

Date: 2013may14
Language: Scala
Level: Beginner

Q.  How do I declare a function that returns nothing
and a function that returns something in Scala?

A.

def myVoidFunc(param1: String) { // your code here } def myReturnFunc(param1: String): Integer = { // Your code here return 88 // You can use "return" our just the value of the last statement }