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

相关推荐
ALex_zry3 分钟前
Rust语言基础分析与C++对比:系统编程的现代演进
java·c++·rust
你不是我我10 分钟前
【Java 开发日记】阻塞队列有哪些?拒绝策略有哪些?
java·开发语言
lpruoyu14 分钟前
HTTP+XML形式完成请求交互
java
7澄115 分钟前
Java Socket 网络编程实战:从基础通信到线程池优化
java·服务器·网络·网络编程·socket·多线程·客户端
2201_7578308715 分钟前
反射的概念
java·开发语言
Pocker_Spades_A15 分钟前
DeepCore:大模型统一网关,Claude 免费体验与跨模型技术洞察
java·服务器·数据库
Arva .20 分钟前
Spring Boot自动配置原理
java·spring boot·后端
寻星探路21 分钟前
Java EE初阶启程记15---文件操作和IO
java·java-ee
阿巳helloWorld22 分钟前
SpringMVC底层流程解析
java·开发语言
heartbeat..23 分钟前
介绍java中常用于处理 Excel 文件的Apache POI
java·apache·excel·poi