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

相关推荐
qualifying1 天前
JavaEE——多线程(4)
java·开发语言·java-ee
better_liang1 天前
每日Java面试场景题知识点之-DDD领域驱动设计
java·ddd·实体·领域驱动设计·架构设计·聚合根·企业级开发
li.wz1 天前
Spring Bean 生命周期解析
java·后端·spring
czlczl200209251 天前
深入解析 ThreadLocal:架构演进、内存泄漏与数据一致性分析
java·jvm·架构
盖世英雄酱581361 天前
不是所有的this调用会导致事务失效
java·后端
少许极端1 天前
Redis入门指南(五):从零到分布式缓存-其他类型及Java客户端操作redis
java·redis·分布式·缓存
宠..1 天前
优化文件结构
java·服务器·开发语言·前端·c++·qt
sheji34161 天前
【开题答辩全过程】以 疫情物资捐赠系统为例,包含答辩的问题和答案
java
sinat_255487811 天前
InputStream/OutputStream小讲堂
java·数据结构·算法
乌日尼乐1 天前
【Java基础整理】java数组详解
java·后端