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

相关推荐
HerayChen12 小时前
HbuilderX 内存溢出报错
java·大数据·linux
程序员小白条13 小时前
0经验如何找实习?
java·开发语言·数据结构·数据库·链表
小马爱打代码13 小时前
Spring AI:搭建自定义 MCP Server:获取 QQ 信息
java·人工智能·spring
郭涤生13 小时前
QT 架构笔记
java·数据库·系统架构
daidaidaiyu13 小时前
基于LangGraph开发复杂智能体学习一则
java·ai
小小8程序员14 小时前
STL 库(C++ Standard Template Library)全面介绍
java·开发语言·c++
a努力。14 小时前
Redis Java 开发系列#2 数据结构
java·数据结构·redis
a努力。15 小时前
腾讯Java面试被问:String、StringBuffer、StringBuilder区别
java·开发语言·后端·面试·职场和发展·架构
Vic1010116 小时前
解决 Spring Security 在异步线程中用户信息丢失的问题
java·前端·spring
QD_IT伟16 小时前
SpringBoot项目整合Tlog 数据链路的规范加强
java·spring boot·后端