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

相关推荐
韩师学子--小倪5 小时前
fastjson与gson的toString差异
java·json
Drawing stars6 小时前
JAVA后端 前端 大模型应用 学习路线
java·前端·学习
nbsaas-boot6 小时前
SQL Server 存储过程开发规范(公司内部模板)
java·服务器·数据库
行百里er6 小时前
用 ThreadLocal + Deque 打造一个“线程专属的调用栈” —— Spring Insight 的上下文管理术
java·后端·架构
玄〤6 小时前
黑马点评中 VoucherOrderServiceImpl 实现类中的一人一单实现解析(单机部署)
java·数据库·redis·笔记·后端·mybatis·springboot
J_liaty7 小时前
Spring Boot拦截器与过滤器深度解析
java·spring boot·后端·interceptor·filter
亲爱的非洲野猪7 小时前
Java锁机制八股文
java·开发语言
rgeshfgreh7 小时前
C++字符串处理:STL string终极指南
java·jvm·算法
Zoey的笔记本8 小时前
「支持ISO27001的GTD协作平台」数据生命周期管理方案与加密通信协议
java·前端·数据库
lpfasd1238 小时前
Spring Boot 4.0.1 时变更清单
java·spring boot·后端