7. [Exercise] Functions in Scala
Activity
For this activity, go ahead and import from the resource the file LearningScala3.scala
LearningScala3.scala mainly talks about the building blocks of Functional Programming for Scala Code
The follow defines how to define a function in Scala
Scala do not need to explicitly declare a return statement to return the value
Scala will return the last value found in the function scope
Scala can take in other functions as parameter for its current Function parameter
Need to declare => as the other function to transform to this current method return value
You can declare Lambda functions in Scala without even explicitly giving them a name
Exercise
Last updated