‘<>‘ 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博客

相关推荐
abcnull6 分钟前
用ASM做精准测试(Java)
java·jar·asm·字节码·精准测试
@杰克成37 分钟前
Java学习26
java·学习·idea
伏加特遇上西柚1 小时前
Loki+Alloy+Grafana日志采集部署
java·linux·服务器·spring boot·grafana·prometheus
阿丘Akiu2 小时前
Linux部署我的世界服务器
java
折哥的程序人生 · 物流技术专研2 小时前
《Java面试85题图解版(二)》进阶深化中篇:Spring核心 + 数据库进阶
java·后端·spring·面试
SamDeepThinking2 小时前
写代码不考虑前后兼容,迟早要还的
java·后端·程序员
亿牛云爬虫专家2 小时前
深度解析:数据采集场景下的 Java 代理技术实战
java·开发语言·数据采集·动态ip·动态代理·代理配置·连接池复用
小小仙。2 小时前
IT自学第四十二天
java·开发语言
java1234_小锋2 小时前
说一下Spring的事务传播行为?
java·数据库·spring
庞轩px2 小时前
第四篇:SpringBoot自动配置——约定大于配置的底层原理
java·spring boot·后端·spring·自动配置·注解开发