Iterating over the map and calling another method

前端 未结 1 996
野的像风
野的像风 2021-01-28 13:24

I am getting an map as shown below inside a method

Map result1 =jmxService.generateMabc(p1, p2,p3,p4);

now the map resu

相关标签:
1条回答
  • 2021-01-28 13:39

    An Integer is not a String. So j = entry.getKey() doesn't make sense.

    You need to transform the Integer into a String (by calling toString() for example):

    j = entry.getKey().toString();
    

    You really need to learn to

    • read the error messages from the compiler, which tell you waht is wrong and where
    • read the javadoc of the classes you're using, to understand what you can do with them.
    0 讨论(0)
提交回复
热议问题