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 }
Programming Tips - Scala: How to declare a function that returns nothing
Date: 2013may14
Update: 2025oct23
Language: Scala
Level: novice
Q. Scala: How to declare a function that returns nothing
and a function that returns something in Scala?
A.