The Java class I am trying to subclass has a method like:
public abstract void foo(Map var1);
I can't figure out how to override that method. The Java class I am subclassing from does not use generics.
In Scala I tried:
override def foo(var1:java.util.Map[Int,Int]){ }
But the compiler gives me the error message that it overrides nothing..
The heart of the problem is that Scala expects type parameters on the Map, however the Java class doesn't use them.
This is going to make it work
override def foo(var1:java.util.Map[_,_]){ }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With