带小数点的String 转int java.lang.Double cannot be cast to java.lang.Integer
带小数点的String转int
HashMap<String, Object> map = new HashMap<String,Object>();
map.put("taskID", 10086);
map里取出来直接转型的话会报错
(Integer) param.get("taskID")
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer
解决方法
String taskId ="10086.0";
iTaskId = Double.valueOf(taskId).intValue();