Can I use a third party scala library in java?

Viewed 4829

I recently wanted to develop a spark project in Java and interact with Hbase. I found a third party library called spark hbase connector, but it is written in Scala. Can I just use classes from this library in Java directly or should I make a scala-java mixed project?

Thanks for your attention, I am not very familiar with this part.

1 Answers

You can, a class is a class whether it's defined in scala or Java or Kotlin or literally any JVM language provided the data types are compatible.

Related