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

相关推荐
星火开发设计29 分钟前
序列式容器:deque 双端队列的适用场景
java·开发语言·jvm·c++·知识
java1234_小锋43 分钟前
Java高频面试题:为什么Zookeeper集群的数目一般为奇数个?
java·zookeeper·java-zookeeper
草履虫建模1 小时前
Java 集合框架:接口体系、常用实现、底层结构与选型(含线程安全)
java·数据结构·windows·安全·决策树·kafka·哈希算法
坚持就完事了1 小时前
Java泛型
java·开发语言
cyforkk1 小时前
YAML 基础语法与编写规范详解
java
亓才孓2 小时前
[Spring测试]TestRestTemplate
java·后端·spring
逆光的July2 小时前
扫码登录的设计与实现
java
Miqiuha2 小时前
工作答辩框架
java·开发语言
happymaker06262 小时前
Java学习日记——DAY25(JavaSE完结)
java·开发语言·学习
CHANG_THE_WORLD2 小时前
C++指针与引用:从语法到底层的全面剖析
java·数据结构·c++