1

I have an abstract class, written in Java:

abstract class AbstractJavaClass {
  abstract public Map<String, String> method(Map<String, String> params);
}

I'm trying to extend this class in scala:

class ScalaConcreteClass extends AbstractJavaClass {
  override def method(params: ...): ...
}

First I've written type (...) in scala as Map[String, String] (just didn't know what to try else :)), but it says: (Note that java.util.Map[java.lang.String,java.lang.String] does not match Map[String,String])

How should I override that methods?

1
  • 2
    params: java.util.Map[String, String] does not work? BTW your AbstractJavaClass uses Scala syntax. Commented Sep 11, 2012 at 11:14

1 Answer 1

4

See this question. I think you want to write Map[java.lang.String, java.lang.String](or even java.util.Map[java.lang.String, java.lang.String]) (as the compiler says, actually).

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, seems question is pretty lame, and solution is obvious, works in reduced form also: java.util.Map[String, String]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.