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

相关推荐
东离与糖宝几秒前
OpenClaw 企业级实战:Java 微服务集成 AI 智能体,自动处理业务流
java·人工智能
半瓶榴莲奶^_^5 分钟前
优先级队列(堆)
java·数据结构·算法
东离与糖宝5 分钟前
成本砍半!Java 生产环境 INT4/INT8 模型量化 + 提示词缓存落地
java·人工智能
Lyyaoo.6 分钟前
Spring中Bean的作用域与生命周期
java·后端·spring
遇见你...6 分钟前
B03 SpringMVC拦截器
java·开发语言
星晨雪海6 分钟前
缓存更新操作实例
java·spring·缓存
東雪木10 分钟前
Java学习——接口 (interface) 与抽象类 (abstract) 的本质区别、选型标准
java·开发语言·jvm·学习·java面试
_MyFavorite_11 分钟前
JAVA重点基础、进阶知识及易错点总结(16)多线程基础(Thread & Runnable)
java·开发语言
大数据新鸟16 分钟前
java8基础知识--字符串
java
ChoSeitaku17 分钟前
NO.2|数据结构设计|日志封装|DeepSeel接入封装|全量返回实现测试|SSE|流式响应实现测试
java·jvm·数据结构