Xlaudius
Xlaudius

Reputation: 1837

Having written a library in Scala, can I use it by Java code?

I am quite aware that many threads have been devoted to this subject, but it seemed to me, that mixing Scala and Java isn't that obvious.

So my background and expectancies first:

I used to code in Groovy and mixing it with Java is as simple, as it gets. Java is valid Groovy code (almost always), and in Groovy you can even implement pure Java interfaces, so that these are then used by other pure Java code. Simple!

So my questions are:

Upvotes: 3

Views: 517

Answers (1)

GJK
GJK

Reputation: 37369

  1. Yes, they are both interchangable. Look here.
  2. Yes, to run Scala code you will need the JAR file. (Check the conclusion of this.) The size is a known issue among Scala developers. I remember hearing about a stripped down version of the library, but I don't know if that came into existence or not.

Upvotes: 3

Related Questions