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

相关推荐
文丑颜不良啊30 分钟前
LeetCode2761~2780题目解析
java·leetcode
IT枫斗者枫哥1 小时前
子线程断言失败,JUnit 为什么还显示通过?
java·后端
考虑考虑3 小时前
JDK27中的Set.ofLazy
java·后端·java ee
文丑颜不良啊3 小时前
LeetCode2841~2860题目解析
java·leetcode
小南家的青蛙3 小时前
Tomcat与Jetty深度对比
java·tomcat·jetty
乌暮5 小时前
Spring AOP 与 Spring 事务:用大白话彻底理解原理与实践
java·数据库·spring boot·后端·sql·学习·spring
YDS8295 小时前
Small Spring IOC篇:容器事件及其监听器
java·spring
金銀銅鐵5 小时前
带您看懂字节码指令(三):一行加法里有什么
java·jvm
文丑颜不良啊5 小时前
LeetCode2921~2940题目解析
java·leetcode
北漂人Java6 小时前
基于 Spring AI Alibaba WorkFlow 构建 Java 生产级 AI Agent
java·人工智能·spring