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

相关推荐
一级新生7 分钟前
LLM _ Agent _ Skill _ 专家 的关系与选型笔记
java·开发语言·人工智能·笔记·大模型·智能体·skill
文丑颜不良啊8 分钟前
LeetCode1541~1560题目解析
java·leetcode
她说彩礼65万12 分钟前
C# TaskCompletionSource
java·开发语言·c#
当战神遇到编程15 分钟前
Java 基础入门(七):递归详解——执行原理、方法调用栈与经典练习
java
若亦_25 分钟前
排序>>交换排序
java·数据结构·算法
Wang's Blog30 分钟前
MongoDB 地理位置上报实战:从接口设计到覆盖写入的完整实现
java·交友
鬼手点金1 小时前
Skills:领域能力的可组合单元
java·人工智能·笔记·自动化·1024程序员节
captain3769 小时前
MyBatis(入门5)其他查询操作
java·数据库·spring boot·mybatis
Novproxy_Z10 小时前
商用代理避坑:如何识别商家拿机房 IP 冒充住宅 IP
java·网络·tcp/ip
文丑颜不良啊10 小时前
LeetCode1481~1500题目解析
java·leetcode