‘<>‘ 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 分钟前
6.2 Object类
java·开发语言·python
Eric_Makabaka17 分钟前
微服务重要知识点
java
lkbhua莱克瓦2421 分钟前
Java进阶——集合进阶(MAP)
java·开发语言·笔记·github·学习方法·map
u01196082325 分钟前
java 不可变集合讲解
java·开发语言
Qiuner34 分钟前
Spring Boot 进阶:application.properties 与 application.yml 的全方位对比与最佳实践
java·spring boot·后端
寒山李白37 分钟前
Mybatis使用教程之XML配置方式实现增删改查
xml·java·mybatis
Seven971 小时前
剑指offer-38、⼆叉树的深度
java
Kapaseker1 小时前
一文入门 Java Stream
java
optimistic_chen1 小时前
【Java EE进阶 --- SpringBoot】Spring事务
java·spring boot·笔记·spring·java-ee·事务
leonardee1 小时前
【玩转全栈】----Django基本配置和介绍
java·后端