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

相关推荐
麻瓜生活睁不开眼6 小时前
Android16修改全局桌面视图边框四直角显示为弧边圆角
android·java·深度学习
dear_bi_MyOnly6 小时前
【MyBatis 操作数据库】
java·数据库·学习·mybatis·学习方法
2601_953720827 小时前
【计算机毕业设计】基于Spring Boot的心理健康咨询与评测系统的设计与实现
java·spring boot·后端
丈剑走天涯8 小时前
JDK 17 正式特性
java·开发语言
圣光SG8 小时前
Java操作题练习(七)
java·开发语言·算法
@航空母舰10 小时前
SpringBoot通过Map实现天然的策略模式
java·spring boot·后端
Co_Hui10 小时前
Java 并发编程
java
long31611 小时前
Java 新手入门与实战开发指南
java·开发语言
执笔画流年呀11 小时前
Linux搭建Java项目部署环境
java·linux·运维
程序员天天困11 小时前
Arthas ognl 表达式从入门到实战:掌握在线调试最强的表达式引擎
java·jvm·后端