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

相关推荐
yyxx412123几秒前
上海企业如何选择专业的钉钉服务商
java·大数据·人工智能·钉钉
一杯奶茶¥11 分钟前
水果销售网站 CRM客户信息管理系统 超市管理系 酒店管理系统 健身房管理系统 在线音乐网站 校园招聘系统
java·vue.js·spring boot·mysql·spring·java项目
重生之后端学习15 分钟前
Java入门
java·开发语言·职场和发展
碧海蓝天202221 分钟前
C++法则24:在标准 C++ 中,没有任何可移植的方式判断指针 T* pt 指向的内存位置是否已经 构造了对象,程序员必须手动跟踪哪些元素已构造。
java·开发语言·c++
один but you1 小时前
const和constexpr常量表达式
java·前端·javascript
码云数智-大飞1 小时前
RAII 与智能指针深度拆解
java·前端·算法
云烟成雨TD1 小时前
Agent Scope Java 2.x 系列【19】Harness:从零搭建 MySQL 文件系统
java·人工智能·agent
qq3621967051 小时前
阿里裁员新消息(2026最新动态汇总)
java·开发语言·前端
a1117761 小时前
“黑夜流星“个人引导页 网页html
java·前端·html
砚底藏山河1 小时前
沪深A股:如何获取基金持股数据
java·python·数据分析·maven