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

相关推荐
BerrySen17811 小时前
迈向 Next-Gen Java:企业级高并发架构演进与大模型 Agent 落地深度实战
java·开发语言·架构
technology_x11 小时前
2026年财务报表分析软件测评:兼容与安全解析
java·服务器·前端
兰令水11 小时前
hot100【acm版】【2026.7.25/26打卡-java版本】
java·算法·排序算法
Nebula_g12 小时前
Java实现本地Socket通信(三)
java·开发语言·学习·socket·可视化
一水12 小时前
java运行排错,新码旧jar
java·开发语言·jar
wuqingshun31415912 小时前
JAVA中的注解原理是什么?
java
Python+9912 小时前
Java 编程语言入门指南
java·开发语言
huahailing102414 小时前
Spring Boot 集成 XXL-Job 完整实现方案(支持动态CRUD)
java·spring boot·后端
薛定谔的猫-菜鸟程序员14 小时前
基于 Electron 的本地短视频解析与下载工具:架构设计与工程实践
java·electron·音视频
音符犹如代码15 小时前
Arthas Profiler 火焰图实战:CPU 热点在哪一目了然
java·jvm·spring boot