您的位置:首页 > 其它

Cannot instantiate the type Map<String,Boolean>

2014-12-14 15:38 721 查看
无法实例化类型Map<String,Boolean>
错误代码:

Map<String, Boolean> modelPropertys = new Map<String, Boolean>();
看了一下Map的定义,public abstract interface java.util.Map
原来是抽象接口,不能直接实例化,需要使用它的实现类;
正确写法如下:

Map<String, Boolean> modelPropertys = new HashMap<String, Boolean>();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: