Any
Just as Object is the root of all objects in java, Any is the root of all objects in Scala. It is the basic object unit, in scala, from which all other objects are derived.
Package
In Scala, package definition looks like so:
package shape {
// All class definitions and methods and functions go in here.
abstract class Z {
def greet() : Unit
}
class A extends Z{
override greet)() = println("A here!")
}
class B extends Z{
override greet() = println("B here!")
}
def aMethod = {
}
}
Unit in Scala is like void in Java. Abstract classes are denoted by the keyword abstract and all methods in an abstract class are automatically abstract. The extend keywords behaves similarly to its Java equivalent, and the override keyword is a means of overriding the default implementation and providing a new one.