Scala - Type Checking and Casting
Scala vs Java
Scala | java |
---|---|
obj.isInstanceOf[Cl] |
obj instanceof Cl |
obj.asInstanceOf[Cl] |
(Cl) obj |
classOf[Cl] |
Cl.class |
Scala | java |
---|---|
obj.isInstanceOf[Cl] |
obj instanceof Cl |
obj.asInstanceOf[Cl] |
(Cl) obj |
classOf[Cl] |
Cl.class |