I have created a project that uses scala that has some abstract classes definitions such as:
abstract class A(n: String) {
require(n!= null)
val name = n
var inputs: List[Input[_]]
var outputs: List[Output[_]]
}
abstract class B(n: String) extends A(n){
def act
def isValid : Boolean
def getCs : List[C[_]]
}
abstract class C[Type]{
var value: Type
}
Now I want to use that project in Java. I have imported scala lib in a new project and added scala project in the build path. I am using eclipse.
However, when I try to do this:
public class CoolClass extends B {
public CoolClass(){ }
}
EDIT:
I have some problems using this in Java that raised me some doubts. Let me enumerate them:
- Can I use Lists from Scala or that gives errors in Java?
- Why vars from A aren't recognized in classes that extend B in Java?
- How can I declare
getCsso it provides an interface withList<C>instead ofList<C<?>>?