‘<>‘ cannot be used with anonymous classes

'<>' cannot be used with anonymous classes

'<>'不能与匿名类一起使用

复制代码
Description	Resource	Path	Location	Type
'<>' cannot be used with anonymous classes	SearchHitSupport.java	/spring-data-elasticsearch/src/main/java/org/springframework/data/elasticsearch/core	line 95	Java Problem

java - Compile error: "'<>' cannot be used with anonymous classes" - Stack Overflow

But the Java compiler gives me the following error message:

复制代码
'<>' cannot be used with anonymous classes

Is there a fundamental reason for this? Or did the just skip the feature in JDK 7, maybe they do it in 8?

'<>' operator is not allowed for source level below 1.7_spencer_tseng的博客-CSDN博客

相关推荐
学习中.........9 分钟前
常见设计模式
java·设计模式
敖正炀31 分钟前
JDBC 到 ORM:Spring Data JDBC、JPA 与 MyBatis 的定位与选型
java
Henray20241 小时前
最低公共祖先 LCA
java·面试
shehuiyuelaiyuehao1 小时前
关于进程和线程的关系
java·开发语言
河阿里1 小时前
SpringBoot:项目启动速度深度优化
java·spring boot·后端
AaronCos1 小时前
弄懂java泛型中的extends和super
java·开发语言
用户239526180101 小时前
别再 new 满天飞了!一文搞懂工厂模式,程序员终于不用手搓对象了 😆
java
阿丰资源1 小时前
基于SpringBoot的企业客户管理系统(附源码)
java·spring boot·后端
两年半的个人练习生^_^2 小时前
SpringBoot 项目使用 Jasypt 实现配置文件敏感信息加密
java·spring boot·后端
JAVA学习通2 小时前
开云集致 Java开发 实习 一面
java·开发语言