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

相关推荐
Lisonseekpan7 分钟前
为什么要避免使用 `SELECT *`?
java·数据库·后端·sql·mysql·oracle
一只小透明啊啊啊啊11 分钟前
Java的中间件
java·开发语言·中间件
Wilson Chen12 分钟前
深入理解 MySQL 事务与锁机制:从 ACID 到 Next-Key Lock 的实证之旅
java·数据库·mysql
学编程就要猛26 分钟前
数据结构初阶:Java中的ArrayList
java·开发语言·数据结构
JH307328 分钟前
10分钟理解泛型的通配符(extends, super, ?)
java·开发语言·windows
在等晚安么1 小时前
力扣面试经典150题打卡
java·数据结构·算法·leetcode·面试·贪心算法
Fency咖啡1 小时前
Spring进阶 - Spring事务理论+实战,一文吃透事务
java·数据库·spring
Zxxxxxy_1 小时前
【MYSQL】增删改查
java·数据库·mysql
菜鸟的迷茫1 小时前
线程池中的坑:线程数配置不当导致任务堆积与拒绝策略失效
java·后端
缺点内向1 小时前
Java 使用 Spire.XLS 库合并 Excel 文件实践
java·开发语言·excel