jonderry
jonderry

Reputation: 23633

Is it impossible to call a scala package function from a java file?

For example, scala.concurrent.promise

What's the best general workaround for such cases if not? Defining a utility object/class in scala that dispatches to the package function?

Upvotes: 2

Views: 124

Answers (1)

wingedsubmariner
wingedsubmariner

Reputation: 13667

A class with the name package is created, with the relevant methods as static members. In this case, you would need to invoke scala.concurrent.package.promise from Java.

However, scala.concurrent.promise is deprecated, use scala.concurrent.Promise.apply instead.

Upvotes: 3

Related Questions