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

相关推荐
是小蟹呀^1 小时前
Spring Security + JWT 面试题整理
java·jwt·springsecurity
spencer_tseng3 小时前
Redis + Nacos.bat
java·windows·dos
troyzhxu4 小时前
列表查询的 GraphQL —— 一行代码终结你的 if-else 地狱!
java·springboot·graphql
孫治AllenSun5 小时前
【DataX】生产环境搭建DataX集群案例
java·开发语言·jvm
好好沉淀6 小时前
@NotBlank(message = “{xxx}“) 注解中花括号的含义
java
fīɡЙtīиɡ ℡6 小时前
内存泄漏产生的原因
java·spring·servlet
hkj88086 小时前
Ubuntu 切换java版本
java·linux·ubuntu
码智社7 小时前
Java实现RSA密钥生成、加密解密、加签验签
java
wear工程师7 小时前
ThreadLocal 在线程池里为什么会串数据:别只会答内存泄漏
java·后端