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

相关推荐
CRMEB系统商城15 分钟前
开源自建还是SaaS订阅?算一笔3年经济账
java·大数据·开发语言·开源
keyipatience1 小时前
线程栈与TLS和线程互斥
java·linux·服务器·开发语言·ubuntu
weixin_408099672 小时前
2026 图片去水印 API 接口完全指南:一键去除图片水印(附 Python/Java/PHP/C# 示例)
java·python·php·图片处理·api调用·图片去水印·石榴智能
钱六两2 小时前
#3、SpringAI 接入deepSeek大模型(喂饭版)
java·spring boot·ai编程
null_173 小时前
IntelliJ IDEA 极致流畅配置方案:Ultra 9 285K + 64GB 内存实测
java·ide·intellij-idea
Herbert_hwt3 小时前
建立Java程序开发
java·开发语言
好好沉淀4 小时前
@ExcelIgnoreUnannotated 和 @AutoMapper 详解
java
愚公移码4 小时前
蓝凌EKP18产品:流程虚拟机(PVM)
java·开发语言·前端
驰骋工作流4 小时前
流程引擎BPM设计之:流程消息
java·工作流引擎·bpm·jflow·ccflow
dogstarhuang4 小时前
从 0 到 1 搭建可收费的 API 开放平台(实战)
java·架构·api