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

相关推荐
nsjqj15 小时前
JavaEE初阶:计算机是如何工作的
java·java-ee
URBBRGROUN46715 小时前
Spring AI Alibaba入门
java·人工智能·spring
她和夏天一样热16 小时前
【实战篇】设计模式在开发中的真实应用
java·开发语言·设计模式
小帅学编程16 小时前
设计模式笔记
java
ss27316 小时前
线程池工作机制:从任务提交到执行的完整决策流程
java·开发语言
yaoxin52112316 小时前
276. Java Stream API - 使用 flatMap 和 mapMulti 清理数据并转换类型
java·开发语言·windows
Vic1010116 小时前
【无标题】
java·数据库·分布式
摇滚侠16 小时前
Java 零基础全套视频教程,异常,处理异常,自定义异常,笔记 124-129
java·笔记
伯明翰java16 小时前
【无标题】springboot项目yml中使用中文注释报错的解决方法
java·spring boot·后端