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

相关推荐
空中海2 分钟前
Nacos 2: Spring Boot Demo 实战
java·spring boot·后端
土豆.exe7 分钟前
Cast Attack:Java 中 Ghost Bits(幽灵比特)引发的新型安全威胁——Java 生态里被忽视的底层风险引发一系列绕过
java·python·安全
shughui16 分钟前
2026最新JDK版本选择及下载安装详细图文教程【windows、mac附安装包】
java·linux·开发语言·windows·jdk·mac
Wenzar_16 分钟前
# D3.js实战进阶:从基础图表到交互式数据仪表盘的全流程构建在现代前端开发中,**数据可视化已成为提升用户体验的核心能力之一
java·javascript·python·信息可视化·ux
TE-茶叶蛋17 分钟前
Spring自动配置分析
java·后端·spring
XiYang-DING18 分钟前
【Java EE】锁策略、锁升级、锁消除和锁粗化
java·redis·java-ee
wu85877345721 分钟前
Java AI Harness 落地:拥抱框架还是回归本质?深度解析选型之道
java·人工智能·回归
北风toto22 分钟前
SpringBoot 获取配置文件值、获取环境变量的方式
java·spring boot·后端
空中海29 分钟前
Nacos3: 面试题库
java·面试·职场和发展
摇滚侠30 分钟前
sqlplus “/ as sysdba“ 什么意思
java·数据库·oracle