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

相关推荐
tqs_12345几秒前
Spring Boot 和 Spring异同
java
橘颂TA2 分钟前
C++ 信号量
java·开发语言
程序猿20233 分钟前
Java Thread
java·开发语言·python
梅梅绵绵冰3 分钟前
springboot初步1
java·前端·spring boot
jason.zeng@15022076 分钟前
POM构造Spring boot多模块项目
java·spring boot·后端
indexsunny11 分钟前
互联网大厂Java面试实录:Spring Boot微服务在电商场景中的应用与挑战
java·spring boot·redis·mysql·security·microservices·interview
编程彩机12 分钟前
互联网大厂Java面试:从分布式缓存到微服务架构的技术场景解析
java·redis·微服务·分布式事务·分布式缓存·面试解析
独自破碎E14 分钟前
【字节面试手撕】大数加法
java·算法
鱼跃鹰飞16 分钟前
LeetCode热题100: 49.字母异位词分组
java·数据结构·算法·leetcode
studyForMokey20 分钟前
【Android面试】Java & Kotlin语言
android·java·面试