Wednesday, 2 October 2013

The method put(Integer, MyClass) in the type Map is not applicable for the arguments (String, int)

The method put(Integer, MyClass) in the type Map is not applicable for the
arguments (String, int)

private Map<Integer,MyClass> calc()
{
Map<Integer,MyClass> closest = new HashMap<Integer,MyClass>();
//...
closest.put("index",(i+1));
closest.put("poi",myclass_element);
return closest;
}
The method put(Integer, MyClass) in the type Map is not applicable for the
arguments (String, int)
The function calc should return myclass_element and an integer value
(i+1). How to to do this?

No comments:

Post a Comment