WorksheetsScala - Syntax
Total questions: 25
Worksheet time: 14mins
Scala is a combination of which programming paradigms?
Scala programs are executed on which platform?
Which keyword is used to declare a constant value in Scala?
Which keyword is used to declare a mutable variable in Scala?
What is the default return type of a Scala function if not specified?
Which of the following is the entry point of a Scala application?
Scala supports type inference. This means:
Which collection is immutable by default in Scala?
Array Buffer
Hash map
What does List(1,2,3).head return?
What does List(1,2,3).tail return?
Which method is used to join collection elements into a string?
join()
concat()
mkString()
toString()
What is the output of println(10 + "20")?
Error
30
Which data type represents no meaningful value in Scala?
What does contains() method return?
Which symbol is used for single-line comments in Scala?
--
Which of the following is a valid Scala List?
List[1,2,3]
List(1,2,3)
(1,2,3)
{1,2,3}
Which operator is used for string interpolation?
What does Set(1,1,2,3) contain?
Scala source files have which extension?
Which method checks whether an element exists in a collection?
Which data type is the supertype of all Scala types?
Scala code is compiled into which format?
Which of the following is NOT a Scala keyword?
def
val
function
var
Scala supports (a) inference, where the compiler determines the data type automatically.
In Scala, everything is treated as an (a) .
