So I have a Java method:
public abstract List<Class<? extends MyClass>> getListOfClasses();
and I need to override it in Scala. Here is how I am currently doing it:
override def getListOfClasses: java.util.List[Class[_ <: MyClass[_]]] = { null }
However, this does not compile, and I get the error: method getListOfClasses has incompatible type
What am I doing wrong?
EDIT: MyClass is defined in Java like this:
abstract class MyClass[T] extends MyOtherClass[T] {...}
FINAL EDIT: As suggested by @AlexeyRomanov below, changing my Java method return type fixed the problem:
public abstract List<Class<? extends MyClass<?>>> getListOfClasses();