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)
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
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.