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

相关推荐
Dicky-_-zhang11 小时前
日志管理实战:ELK与Loki对比选型与落地实践
java·jvm
nJI74egg111 小时前
JavaEE初阶---《JUC 并发编程完全指南:组件用法、原理剖析与面试应答》
java·面试·java-ee
刮风那天12 小时前
Android AMS创建进程不用Binder而用Socket?
android·java·binder
程序员老邢12 小时前
【技术底稿 37】Spring Boot 3.x 自动装配 “死锁” 排查:3 个注解实现条件化装配与 Mock 兜底
java·spring boot·后端·自动装配·rag·技术底稿
日月云棠12 小时前
JAVA数据结构与算法 - 基础:链表
java·后端
日月云棠12 小时前
JAVA数据结构与算法 - 基础:栈 (Stack) 深度解析
java·后端
xiguolangzi12 小时前
java使用Map映射遍历方法
java·后端
日月云棠12 小时前
JAVA数据结构与算法 - 基础:队列 (Queue) 全方位解析
java·后端
JAVA面经实录91712 小时前
Java集合大全终极手册(一)
java·开发语言
Cosolar12 小时前
吃透 Spring Cloud Gateway:基于 Spring Boot 3 的核心原理、企业级实战与避坑指南
java·spring cloud·架构