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

相关推荐
会编程的吕洞宾6 小时前
LangChain4j RAG 分块策略实战:检索质量提升 80% 的 Chunking 调优全解
java·人工智能·后端
Sagittarius_A*6 小时前
【LitCTF2026】lit_ezsql
android·java·数据库
LayZhangStrive6 小时前
数据结构与算法 - 堆排序
java·数据结构·算法·排序算法·堆排序·大根堆
是2的10次方啊6 小时前
线程 Dump 还是 Heap Dump?线上故障时先抓哪个
java
Zane19947 小时前
复制算法明明要浪费一半内存,为什么新生代还偏偏用它
java·后端
worilb7 小时前
Java/JVM 常见诊断文件对比
java·开发语言
toolsmith7 小时前
AI能替你读代码,但替代不了你积累洞察力:一次YouTrack逆向实战全记录
java·源码阅读
步行cgn7 小时前
Spring Boot 绑定简单 Bean 详解
java·spring boot·后端
鹿角片ljp7 小时前
我如何用 Frontend Design Skill 重构平台
java
未秃头的程序猿7 小时前
分库分表一年后,我复盘了当时最该想清楚的三件事
java·数据库·后端