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

相关推荐
014-code17 小时前
订单超时取消与库存回滚的完整实现(延迟任务 + 状态机)
java·开发语言
java1234_小锋18 小时前
Java高频面试题:Springboot的自动配置原理?
java·spring boot·面试
末央&19 小时前
【天机论坛】项目环境搭建和数据库设计
java·数据库
枫叶落雨22219 小时前
ShardingSphere 介绍
java
花花鱼19 小时前
Spring Security 与 Spring MVC
java·spring·mvc
言慢行善20 小时前
sqlserver模糊查询问题
java·数据库·sqlserver
专吃海绵宝宝菠萝屋的派大星20 小时前
使用Dify对接自己开发的mcp
java·服务器·前端
大数据新鸟20 小时前
操作系统之虚拟内存
java·服务器·网络
Tong Z20 小时前
常见的限流算法和实现原理
java·开发语言
凭君语未可20 小时前
Java 中的实现类是什么
java·开发语言