‘<>‘ 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 小时前
并发编程(六)
java·jvm
拽着尾巴的鱼儿6 小时前
springboot openfeign 自定义feign 接口重试机制
java·spring boot·后端
白露与泡影7 小时前
2026大厂Java面试题大全!牛客网最新版
java·开发语言
EntyIU7 小时前
JVM内存与GC笔记
java·jvm·笔记
XS0301068 小时前
并发编程 六
java·后端
yaoxin5211238 小时前
419. 现代 Java IO 最佳实践 - 写入文本文件
java·windows·python
雪宫街道8 小时前
synchronized 锁的范围:对象锁、类锁与代码块锁
java·jvm·后端·面试
x***r1518 小时前
linux安装 jdk-8u291-linux-x64.tar.gz 详细步骤(解压配置环境变量)
java
极光代码工作室9 小时前
基于SpringBoot的校园论坛系统
java·springboot·web开发·后端开发
XS0301069 小时前
Spring Bean 作用域 & 生命周期
java·后端·spring