HashMap cannot cast other type?

public Human setName(){ Human a=null;

    System  .out.println("change name ");
    System.out.println("enter Security No : ");
    String inputsecNo=sc.next();

    System.out.println("enter name you wish to change : ");
    String name=sc.next();
    Human value=null;
    value= humanList.get(inputSecNo);
    value.setName(name);

I don't know why this error occur... I made a HashMaphumanList and want to get value of key(String). it says HashMap cannot be cast to Human... i used iterator to get value of map. but it occur same error.

链接地址: http://www.djcxy.com/p/67908.html

上一篇: 将数据保存到不同的活动上

下一篇: HashMap不能转换其他类型?