Intellig idea jdk明明是1.8了,还是 出现Diamond types are not supported at this language level
2017-04-26 11:13
4619 查看
本来jdk是1.6或之前的集合是需要
List<PublicBlogListBean> _hotDatas = new ArrayList<PublicBlogListBean>();
但是在JDK 1.7里新增了一个新特性:
增强对通用实例创建(diamond)的类型推断 :
类型推断是一个特殊的烦恼,下面的代码:
Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
通过类型推断后变成:
Map<String, List<String>> anagrams = new HashMap<>();
这个<>被叫做diamond(钻石)运算符,这个运算符从引用的声明中推断类型。
修改如下:
单击File | Project Structure菜单项
如果看到:9-JDK modelarization etc.最好别手贱,这个不是
List<PublicBlogListBean> _hotDatas = new ArrayList<PublicBlogListBean>();
但是在JDK 1.7里新增了一个新特性:
增强对通用实例创建(diamond)的类型推断 :
类型推断是一个特殊的烦恼,下面的代码:
Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
通过类型推断后变成:
Map<String, List<String>> anagrams = new HashMap<>();
这个<>被叫做diamond(钻石)运算符,这个运算符从引用的声明中推断类型。
修改如下:
单击File | Project Structure菜单项
如果看到:9-JDK modelarization etc.最好别手贱,这个不是
相关文章推荐
- idea jdk明明是1.8了,还是 出现Diamond types are not supported at this language level
- IDEA 出现Diamond types are not supported at this language level
- IDEA 出现Diamond types are not supported at this language level
- diamond types are not supported at this language level
- diamond types are not supported at this language level
- Android Studio 出现 lande expression are not supported at this language level 的解决方案
- Lambda expressions are not supported at this language level
- IDEA 出现编译错误 Multi-catches are not supported a this language level 解决方法
- 【lamdba表达式】lambda expressions are not supported at this language level
- Generics are not supported at this language level
- lambda expressions are not supported at this language level(需设置project language level)
- [转]IDEA 出现编译错误 Multi-catches are not supported a this language level 解决方法
- lambda expressions are not supported at this language level
- lambda expressions are not supported at this language level解决方法
- lambda expressions are not supported at this language level错误
- Annotations are not supported at this language level
- lambda expressions are not supported at this language level
- lambda expressions are not supported at this language level
- IDEA提示Multi-catches are not supported at this language level的解决办法
- lambda expressions are not supported at this language level