1.
In Scala, which of the following statements about the lists is true:
1. A list is an immutable recursive data structure while array is a sequential mutable data structure.
2. The lists are covariant while arrays are invariant.
3. A list is a fixed-sized data structure while an array is variable-sized data structure.
4. A list can only be concatenated by using “:::” operator.
2.
In Scala, which of the following objects is used to provide trampoline support?
3.
In Scala, which of the following methods is automatically executed when the executor object is compared by using the match statement?
4.
What is the output of the following Scala code:
object Demo {
    def main(args: Array[String]) {
        val x = Demo(7)
        println(x)
        x match {
            case Demo(num) => println(x + " is bigger two times than " + num)
            case _ => println("I cannot calculate")
        }
    }
    def apply(x: Int) = x * 4
    def unapply(z: Int): Option[Int] =
        if (z % 2 == 0) Some(z / 2)
        else None
}
5.
What is the output of the following Scala code:
trait Printable extends Any {
    def print(): Unit = println(this)
}
class Wrapper(val underlying: Int) extends AnyVal with Printable

object Demo {
    def main(args: Array[String]) {
        val w = new Wrapper(5)
        w.print()
    }
}
6.
In Scala, which of the following statements about the operation xs mkString (pre, sep, post) is true:
1. It takes three arguments.
2. A prefix string pre should be displayed in front of all the elements on which this operation is performed.
3. A separator string sep should be displayed between the successive elements on which this operation is performed.
7.
In Scala, which of the following statements about the operation import scala.collection.mutable is true?
8.
In Scala, which of the following annotations allows the users to access multiple threads?
9.
What is the output of the following Scala code:
object Demo {
    def main(args: Array[String]) {
        println(matchTest("1"))
        println(matchTest("test"))
        println(matchTest(2))
    }

    def matchTest(x: Any): Any = x match {
        case 1 => "one"
        case "two" => 2
        case y:
            Int => "scala.Int"
        case _ => "many"
    }
}
10.
Which of the following statements about Scala is false?