You can use Java classes in a Scala program, but you must use the Scala syntax:
val node: DomNode = node.getFirstChild()
Java syntax cannot be used in the form of Type variableName .
edit (thanks to ericacm) - You can also just specify
val node = node.getFirstChild()
therefore, you do not need to explicitly specify the node type; you can let Scala infer a type.
source share