1.
What is the output of the following Scala code:
trait Equal {
    def isEqual(x: Any): Boolean
    def isNotEqual(x: Any): Boolean = !isEqual(x)
}

class Point(xc: Int, yc: Int) extends Equal {
    var x: Int = xc
    var y: Int = yc
    def isEqual(obj: Any) = obj.isInstanceOf[Point] && obj.asInstanceOf[Point].x == y
}

object Demo {
    def main(args: Array[String]) {
        val p1 = new Point(2, 3)
        val p2 = new Point(2, 4)
        val p3 = new Point(3, 3)

        println(p1.isNotEqual(p3))
        println(p1.isNotEqual(p1))
        println(p1.isNotEqual(p2))
    }


}
2.
What is the output of the following Scala code:
import scala.util.matching.Regex
object Demo {
    def main(args: Array[String]) {
        val pattern = new Regex("(S|s|s s)cala")
        val str = "Scala is scalable and cool"
        println((pattern findAllIn str).mkString(","))
    }
}
3.
In Scala, which of the following is the correct sequences to start an actor object:
Subclass the API scala.actors.Actor
Implement the start() method
Implement the act() method
4.
Which of the following statements about Scala is false?
5.
In Scala, a class can extend another class, whereas a case class can not extend another case class because __________________________.
6.
In Scala, which of the following statements about the setter and the getter methods is correct?
7.
In Scala, which of the following statements about blocks is incorrect?
8.
In Scala, which of the following statements about the packages is correct:
1. A package can contain classes, objects, traits, and the definitions of functions or variables.
2. A package is accessed with the usage of qualifiers.
3. The visibility cannot be extended to an enclosing package.
4. In background, the package object gets compiled into a JVM class.
9.
What is the output of the following Scala code:
val column1 = elem("Hi") above elem("***")
val column2 = elem("***") above elem("there")
column1 beside column2
10.
In Scala, which of the following statements about the singleton objects is incorrect?