Who is this quiz for Scala course is designed for programmers who are already familiar with the basics of Scala programming language and want to improve their knowledge, prepare for the interview or explore corner cases of programming aspects in Scala. This Scala tutorial is originally not designed for beginners, but still covers basic topics. Mostly designed for developers with professional backgrounds starting from Junior to Senior / Architect.
About this Quiz
What is Scala?
You can find Scala interview questions as well as code examples from different topics starting from functions and pattern matching to evaluation strategies (call-by-name, call-by-value) and Scala collections, also including more advanced topics from cats library - Monoids and Semigroups.
Programming in Scala can be tricky and challenging, so Scala quiz in this course is based on real programming code examples and nuances of the scala-lang.
To accomplish this, you'll need to append the array argument with a colon and an _* symbol, like this:
scala> val arr = Array("What's", "up", "doc?") arr: Array[java.lang.String] = Array(What's, up, doc?) scala> echo(arr)
:7: error: type mismatch; found : Array[java.lang.String] required: String echo(arr) ^
This notation tells the compiler to pass each element of arr as its own argument to echo, rather than all of it as a single argument.
scala> echo(arr: _*) What's up doc?
The right-hand side of a val definition is evaluated at the point of the definition itself.
val x = 2 val y = square(x)