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

相关推荐
用户21903265273518 小时前
能省事”。SpringBoot+MyBatis-Plus:开发效率提升10倍!
java·spring boot·mybatis
小楼v18 小时前
构建高效AI工作流:Java生态的LangGraph4j框架详解
java·后端·工作流·langgraph4j
jvstar18 小时前
JNI 面试题及答案
java
虾说羊18 小时前
JVM 高频面试题全解析
java·开发语言·jvm
雨中飘荡的记忆18 小时前
MyBatis SQL解析模块详解
java·mybatis
czlczl2002092518 小时前
Spring Cache 全景指南
java·后端·spring
invicinble18 小时前
透视IDEA,IDEA认识到什么程度算精通
java·ide·intellij-idea
wanzhong233318 小时前
NLS开发日记1-初始化项目
java·项目
Hello.Reader18 小时前
Flink ML VectorAssembler 把多列特征“拼”成一个向量列(数值 + 向量都支持)
java·python·flink
TeamDev18 小时前
使用 Vue.js 构建 Java 桌面应用
java·前端·vue.js