An abstract class, as in Java, cannot be instantiated and only inherited:
An abstract class, as in Java, cannot be instantiated and only inherited:
abstract class Soldier(val firstName: String, val lastName: String) {} // if you uncomment this line, it will fail compilation //val soldier = new Soldier
A class can be placed inside an abstract class just like in java:
In contrast to Java, all values in Scala are objects (including numerical values and functions).
In contrast to Java, all values in Scala are objects (including numerical values and functions). Since Scala is class-based, all values are instances of a class.
Class hierarchy is linear, a class can only extend from one parent class:
A class that extends from another is polymorphic:
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
Please use 'an [Exception] should be thrownBy { ... }' syntax instead
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.