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

相关推荐
Mr_Air_Boy31 分钟前
SpringBoot使用dynamic配置多数据源时使用@Transactional事务在非primary的数据源上遇到的问题
java·spring boot·后端
豆沙沙包?1 小时前
2025年- H77-Lc185--45.跳跃游戏II(贪心)--Java版
java·开发语言·游戏
年老体衰按不动键盘1 小时前
快速部署和启动Vue3项目
java·javascript·vue
咖啡啡不加糖1 小时前
Redis大key产生、排查与优化实践
java·数据库·redis·后端·缓存
liuyang-neu2 小时前
java内存模型JMM
java·开发语言
UFIT2 小时前
NoSQL之redis哨兵
java·前端·算法
刘 大 望2 小时前
数据库-联合查询(内连接外连接),子查询,合并查询
java·数据库·sql·mysql
怀旧,2 小时前
【数据结构】6. 时间与空间复杂度
java·数据结构·算法
大春儿的试验田3 小时前
Parameter ‘XXX‘ not found. Available parameters are [list, param1]
java
程序员JerrySUN3 小时前
[特殊字符] 深入理解 Linux 内核进程管理:架构、核心函数与调度机制
java·linux·架构