Yes, these technologies can be compared; they rely on the same environment. If you have a choice where you need to choose between Scala and Java, we recommend selecting Scala because of compatibility issues. Due to the fact that Java and Scala are both based on JVM, they can be used interchangeably with some limitations:
It’s possible to use Scala instead of Java because the Scala compiler supports and understands all the Java features.
It’s not completely possible to use Java instead of Scala because Scala relies on complex features that are supported by the Scala compiler only (e.g. Java compiler will not understand them without some voodoo magic).
As a result, if you go with Scala, you can work using both technologies, but if you go with Java, you will have to stick to it until you decide to switch.