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

相关推荐
实在智能RPA7 分钟前
航空Agent落地效果评估指标:2026年企业级智能自动化价值度量体系拆解
java·网络·人工智能·ai·自动化
程序员二叉13 分钟前
【JUC】AQS底层深度拆解|独占/共享模式|队列原理全详解
java·开发语言·面试·juc
地铁潜行者18 分钟前
消息堆积后,为什么一扩容消费者,MySQL 先被打崩了?
java·后端
地铁潜行者22 分钟前
订单状态更新成功了,分账消息却没发出去:聊聊本地消息表的一致性坑
java·后端
亦暖筑序22 分钟前
Java 8老系统SQL Agent实战:AI生成候选SQL,安全引擎拦截后再执行
java·人工智能·sql
CodeStats23 分钟前
《源纹天书》卷一:归元初醒(第1-5章)
java
大囚长27 分钟前
大模型服务端如何命中缓存
java·人工智能·缓存·dubbo
摇滚侠27 分钟前
SpringMVC 入门到实战 拦截器 78-82
java·后端·spring·maven·intellij-idea
磊 子34 分钟前
C++移动语义和智能指针
java·开发语言·c++
JAVA面经实录91735 分钟前
Elasticsearch 完整版完整知识体系
java·elasticsearch·搜索引擎·es