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

相关推荐
plainGeekDev3 小时前
null 判断 → Kotlin 可空类型
android·java·kotlin
糖拌西瓜皮3 小时前
Java开发者视角:深入理解Node.js异步编程模型
java·后端·node.js
plainGeekDev3 小时前
getter/setter → Kotlin 属性
android·java·kotlin
一线大码4 小时前
Smart-Doc 的简单使用
java·后端·restful
MacroZheng5 小时前
Claude Code官方桌面端正式发布,夯爆了!
java·人工智能·后端
虚无境5 小时前
如何编写一个SpringBoot项目告警推送的Starter
java·prometheus·webhook
NE_STOP20 小时前
Vide Coding--AI编程工具的选择
java
码云数智-园园20 小时前
C++20 Modules 模块详解
java·开发语言·spring
程序员黑豆21 小时前
JDK 下载安装与配置详细教程
java·前端·ai编程