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

相关推荐
关于不上作者榜就原神启动那件事5 分钟前
从 MDC 到 Agent:我手搓的文档路由协议,在 Spring AI Alibaba 里找到了正式实现
java·人工智能·spring·ai·agent
亦暖筑序24 分钟前
重新认识 AgentScope-Java 2.0:ReActAgent 负责推理,HarnessAgent 负责运行
java·后端·agent
木井巳33 分钟前
【DFS解决floodfill算法】岛屿的最大面积
java·算法·leetcode·深度优先
林森lsjs1 小时前
完结撒花!Java SE 语法阶段总结!
java·开发语言
lupai1 小时前
短信接口快速接入与调用实战指南
java·开发语言·数据库
ltqvibe1 小时前
企业智能问数落地:从一句话到跨系统完整答案
java·人工智能·本体语义平台
会编程的吕洞宾1 小时前
Spring Boot 虚拟线程实战:从原理到生产环境
java·后端·spring
黑桃小柒71 小时前
Prompt 工程的“断舍离“:如何用更少的词让 AI Agent 更聪明
java·后端·spring
撩妹帝九歌1 小时前
Java文件写入与编码、字节数组、字符集、字符编解码 一文打通!
java·开发语言
一路向北North1 小时前
Spring AI(9) :解决百炼平台兼容性问题
java·人工智能·spring