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

相关推荐
pshdhx_albert27 分钟前
AI agent实现打字机效果
java·http·ai编程
沉鱼.441 小时前
第十二届题目
java·前端·算法
赫瑞2 小时前
数据结构中的排列组合 —— Java实现
java·开发语言·数据结构
周末也要写八哥3 小时前
多进程和多线程的特点和区别
java·开发语言·jvm
惜茶4 小时前
vue+SpringBoot(前后端交互)
java·vue.js·spring boot
杰克尼4 小时前
springCloud_day07(MQ高级)
java·spring·spring cloud
NHuan^_^6 小时前
SpringBoot3 整合 SpringAI 实现ai助手(记忆)
java·人工智能·spring boot
Mr_Xuhhh6 小时前
从ArrayList到LinkedList:理解链表,掌握Java集合的另一种选择
java·数据结构·链表
错把套路当深情6 小时前
Java 全方向开发技术栈指南
java·开发语言
han_hanker7 小时前
springboot 一个请求的顺序解释
java·spring boot·后端