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

相关推荐
你怎么知道我是队长几秒前
C语言---未定义行为
java·c语言·开发语言
没有bug.的程序员13 分钟前
Java 序列化:Serializable vs. Protobuf 的性能与兼容性深度对比
java·开发语言·后端·反射·序列化·serializable·protobuf
愚公移码23 分钟前
蓝凌EKP产品:主文档权限机制浅析
java·前端·数据库·蓝凌
Remember_99327 分钟前
【LeetCode精选算法】滑动窗口专题一
java·数据结构·算法·leetcode·哈希算法
开开心心就好35 分钟前
音频编辑工具,多端支持基础剪辑易操作
java·网络·windows·java-ee·电脑·maven·excel
凯子坚持 c41 分钟前
Protocol Buffers C++ 进阶数据类型与应用逻辑深度解析
java·服务器·c++
黎雁·泠崖1 小时前
Java面向对象:对象内存图+成员与局部变量
java·开发语言
窗边鸟1 小时前
小白日记之java方法(java复习)
java·学习
砚边数影2 小时前
AI数学基础(一):线性代数核心,向量/矩阵运算的Java实现
java·数据库·人工智能·线性代数·矩阵·ai编程·金仓数据库
豆沙沙包?2 小时前
2026年--Lc343-1926. 迷宫中离入口最近的出口(图 - 广度优先搜索)--java版
java·算法·宽度优先