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

相关推荐
超梦dasgg14 小时前
Sentinel生产环境实战全解
java·微服务·sentinel
青云计划14 小时前
MySQL技术文档
java·mysql
qq_25183645714 小时前
基于java 汽车检修管理系统设计与实现 论文
java·开发语言·汽车
量子炒饭大师14 小时前
【Linux系统编程】Cyberpunk在霓虹丛林中构建堡垒 ——【基础开发工具(1)】一文带你初步了解 软件包管理器 并 快速上手 yum和apt 工具
java·linux·运维·apt·yum·软件包管理器
Finger#0000FF14 小时前
从零上手VibeCoding(ClaudeCode+DeepSeek V4.Pro)
java·人工智能·ai编程·vibe coding·claudecode
木子墨51614 小时前
系统设计面试 | 实现一个限流器:滑动窗口 → 令牌桶 → 漏桶
java·开发语言·数据结构·数据库·面试·职场和发展
吴声子夜歌15 小时前
Java——synchronized
java·synchronized
不知名的忻15 小时前
交换排序:冒泡排序 vs 快速排序(Java)
java·算法·排序算法
程序员阿明15 小时前
spring boot + vue3 实现RSA加密解密
java·spring boot·后端
wok15715 小时前
IDEA 无法识别 OkHttpClient?cannot resolve symbol问题解决
java·ide·intellij-idea