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

相关推荐
Flynn Liang19 分钟前
流量治理不是限流那么简单:I/O 密集型 Java 服务的 6 层防线
java·微服务·高并发·限流·熔断·系统稳定性·resilience4j
学长毕设21 分钟前
基于SpringBoot智慧养老服务平台设计与实现-附源码
java·spring boot·后端
曹牧1 小时前
Java:“刷新雪崩”
java·开发语言
秋天的怀念_David1 小时前
算法一千零一夜 · 第三十三夜 · 跳表
java·程序人生·算法
Forget the Dream3 小时前
Spring AI 2.0 系列(二):第一个 ChatClient——从注入到一次完整调用
java·人工智能·spring boot·ai·springai
黑十4 小时前
FDE 怎么快速搭一个可演示页面?最小前端方案
java·大数据·前端·数据库·人工智能
神明不懂浪漫4 小时前
【第八章】多线程(一)
java·开发语言·经验分享·笔记
用户54817845909505 小时前
Java 与 Python 在大模型与智能体领域的选型
java·python
文丑颜不良啊5 小时前
LeetCode3341~3360题目解析
java·leetcode
hai_android5 小时前
一行 asLiveData,背后是一座生命周期的桥
android·java·kotlin