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

相关推荐
2401_894915531 小时前
GEO 源码部署如何实现精准地域分发?核心配置参数深度讲解
java·运维·服务器·后端·开源
evans在进步3 小时前
LeetCode 2 两数相加:链表模拟加法,Java 图解进位过程
java·leetcode·链表
2401_858286113 小时前
OS82.【Linux】设计线程池
java·linux·运维·服务器·开发语言·算法·线程池
数据知道4 小时前
IDOR 不安全的直接对象引用:API 越权实战检测
java·开发语言·网络·安全·网络安全
堕落年代4 小时前
Ollama CPU 推理大提示词优化实测报告(细致化数据版)
java·后端·spring
KobeSacre4 小时前
ForkJoinPool 源码
java
wear工程师4 小时前
Kafka 消费者心跳正常,为什么还会被踢出组?拆清 max.poll.interval.ms
java·kafka
SemiTris4 小时前
为什么 C/C++ 不走 Java 式的虚拟机跨平台路线?
java·程序员
weixin_440784115 小时前
【IntentSeivice实现原理】
android·java·开发语言·intentservice
IanSkunk5 小时前
企业AI Agent生产化落地:从技术架构到实施服务的全链路分析
java·人工智能·架构