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

相关推荐
guojl11 分钟前
深度解读jdk8 HashMap设计与源码
java
guojl16 分钟前
深度解读jdk8 ConcurrentHashMap设计与源码
java
爱上语文33 分钟前
Redis基础(5):Redis的Java客户端
java·开发语言·数据库·redis·后端
A~taoker39 分钟前
taoker的项目维护(ng服务器)
java·开发语言
HGW6891 小时前
基于 Elasticsearch 实现地图点聚合
java·elasticsearch·高德地图
hi星尘1 小时前
深度解析:Java内部类与外部类的交互机制
java·开发语言·交互
wuxinyan1231 小时前
Java面试题033:一文深入了解MySQL(5)
java·数据库·mysql·面试
清心歌1 小时前
Java SE线程的创建
java
高兴达2 小时前
Spring boot入门工程
java·spring boot·后端
萧曵 丶2 小时前
Spring @TransactionalEventListener
java·数据库·spring·事务·transactional·异步