Reputation: 12366
Ìs it possible to compile file that contains both scala and java code? I'm doing online course and was given java source files, which I need to extend. Do I have to use only Java in already existing files?
Upvotes: 3
Views: 240
Reputation: 340733
You cannot have both Java and Scala in one file. After all it's either .java
or .scala
.
However you are free to:
...as long as they are in different files.
Upvotes: 9