Cannot instantiate the type Map<String,Boolean>

时间:2014-12-14 15:51:05   收藏:0   阅读:2445

无法实例化类型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>();


原文:http://blog.csdn.net/testcs_dn/article/details/41925571

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!