判断Map中Value的数据类型
public static void main(String[] args) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("aaa",new HashMap<>());
map.put("bbb",new ArrayList<>());
map.put("ccc","String");
map.keySet().forEach(key ->{
Object object = map.get(key);
if (object instanceof Map){
System.out.println(key+"\tMap:"+object);
} else if (object instanceof List){
System.out.println(key+"\tList:"+object);
} else {
System.out.println(key+"\tElse:"+object);
}
});
}