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

相关推荐
荣码3 分钟前
多模态应用入门:让AI看懂图片再回答问题,我踩了4个坑
java·python
用户0723670666020 分钟前
接口级配 50%、方法级配 30%,这个方法实际切多少
java·dubbo
淘源码A23 分钟前
智能预问诊系统源码,基于SpringBoot、MyBatis-Plus、uni-app等技术栈,开箱即用
java·spring boot·源码·二次开发·电子病历·预问诊·智能预问诊
夏幻灵27 分钟前
Java 学习日记:多态
java·开发语言·学习
apcipot_rain31 分钟前
C++转Java日记(19)
java·开发语言
JAVA面经实录91742 分钟前
AI 辅助写单元测试
java·人工智能·单元测试·ai编程
IT枫斗者1 小时前
浏览器跨域预检 OPTIONS:什么时候触发,为什么被接口拒绝
java·开发语言·数据库·mysql·fastapi
SimonKing1 小时前
可以自动部署项目的SSH客户端,部署时间可以摸鱼了
java·后端·程序员
水巷石子1 小时前
从请求到逐字返回:用 Spring WebFlux + SSE 打通 Java 大模型的打字机流式输出
java·后端·spring
水巷石子1 小时前
从一行调用到四种入口:Spring AI 1.x ChatClient 实战与 LangChain4j 选型对比
java·人工智能·spring·langchain