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

相关推荐
SeaDhdhdhdhdh7 小时前
MCP Server 搭建与使用指南
java·ai·agent·mcp
YH55269848 小时前
GPT‑5.6 Sol 原本支持 1M 上下文,Codex 现已放开此前限制,如何看待这次调整?
java·jvm·人工智能·gpt·算法·chatgpt
AI_小站8 小时前
刚面完百度的 Agent 开发岗,我才发现:世界就是个巨大的草台班子
java·开发语言·人工智能·spring·百度·langchain
许彰午9 小时前
03-三种开发模式
java·架构
涟漪海洋9 小时前
创建最新的JDK25镜像,非root环境启动
java
Rain的Java大神之路9 小时前
短信接口被狂刷怎么处理
java·运维·后端·web安全·面试·架构·xss
2602_9599609210 小时前
谢飞机面试大厂:Spring Boot、JVM、Redis、Kafka、微服务与音视频搜索场景求生实录
java·jvm·spring boot·redis·面试题
Zane19941210 小时前
CAS 与原子类:Java 如何实现无锁编程
java·开发语言
略略略咯咯11 小时前
AI玩具-study
java
xier_ran12 小时前
【infra之路】GPU 存储层次总结:L1 / L2 / HBM
java·网络·数据库