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

相关推荐
你有我备注吗4 分钟前
SQL学习之查询
java·sql·学习
xixi092444 分钟前
JMeter5.6.3基础使用教程1
java·开发语言
带刺的坐椅1 小时前
用 Solon ReActAgent 落地发票识别与智能报销
java·llm·solon·react-agent
罗超驿1 小时前
15.Java异常处理:从束手无策到从容应对
java·开发语言
半夜修仙1 小时前
RabbitMQ的推模式和拉模式
java·分布式·中间件·rabbitmq·github·java-rabbitmq
掉鱼的猫1 小时前
用 Solon ReActAgent 落地发票识别与智能报销
java·llm·agent
_kerneler1 小时前
cgroup :限制cpu原理
java·服务器·前端
唐青枫1 小时前
Java Jakarta Validation 实战指南:从参数校验到分组、自定义注解和全局异常处理
java
jvmind_dev2 小时前
第一章:AI Agent 如何重新定义 Java 性能分析
java·agent
从此以后自律2 小时前
Java 并发编程完整讲解
java·开发语言