I\'m trying to inject some Scala code into my existing Java app. (So, being said, I want some more fun).
I create a singleton stuff in Scala
ScalaPow
What were the errors you were getting? Using your Scala sample and the following Java class:
cat test.java
:
import org.fun.*;
public class test {
public static void main(String args[]) {
System.out.println("show my power: " + ScalaPower.showMyPower(3));
}
}
And running it as follows:
java -cp .:<path-to/scala/install-dir>/lib/scala-library.jar test
gives my the output:
show my power: 0, 1, 2