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

相关推荐
郑州光合科技余经理13 分钟前
本地生活系统:多业务订单字段怎么分账本导出
java·开发语言·前端·数据库·uni-app·php·ai编程
YangYang9YangYan1 小时前
2026 校招审计风控岗位 JD 拆解,工具、专业能力与面试考点
java·大数据·人工智能·数据分析
wuminyu6 小时前
Kafka中sendfile与mmap实现机制解析
java·linux·c语言·jvm·c++
考虑考虑8 小时前
Java实现hmacsha256加密算法
java·后端·java ee
captain3768 小时前
▲网络原理(2)-TCP
java·服务器·网络·tcp/ip·java-ee
MetaLite8 小时前
SpringBoot接口分层规范-外网网关内部服务与参数边界
java·数据库·spring boot
Co_Hui8 小时前
Java 线程状态
java
土司大王8 小时前
LeetCode hot100——35.搜索插入位置:Java 二分模板、左闭右开区间与插入点分析
java·算法·leetcode
土司大王9 小时前
LeetCode hot100——34.在排序数组中查找元素的第一个和最后一个位置:Java 二分模板、边界分析
java·算法·leetcode
金金计较.9 小时前
Go语言-3
java·开发语言·golang