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

相关推荐
hero.fei4 分钟前
kaptcha 验证码生成工具在springboot中集成
java·spring boot·后端
mikelv015 分钟前
实现返回树状结构小记
java·数据结构
Duang007_5 分钟前
【LeetCodeHot100 超详细Agent启发版本】两数之和 (Two Sum)
java·人工智能·python
色空大师12 分钟前
maven引入其他项目依赖爆红
java·maven
yangminlei30 分钟前
深入理解Sentinel:分布式系统的流量守卫者
java
JavaEdge.33 分钟前
java.io.IOException: Previous writer likely failed to write hdfs报错解决方案
java·开发语言·hdfs
J_liaty1 小时前
基于ip2region.xdb数据库从IP获取到属地解析全攻略
java·网络·后端
沛沛老爹1 小时前
Web转AI架构篇:Agent Skills vs MCP-混合架构设计模式实战指南
java·前端·人工智能·架构·llm·rag
独自破碎E1 小时前
Java的CMS垃圾回收流程
java·开发语言
oioihoii1 小时前
C++线程编程模型演进:从Pthread到jthread的技术革命
java·开发语言·c++