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

相关推荐
竹叶青_七弦2 小时前
从复制粘贴到Harness:Java后端AI编程的工程化之路
java
wuminyu2 小时前
Linux内核线程调度与虚拟线程调度机制系统级深度剖析
java·linux·c语言·jvm·c++
小溪学编程3 小时前
Java InputStream 详解:从基础到实战
java·python·php
血小板要健康3 小时前
队列 + 宽搜(BFS):二叉树层序遍历 算法总结
java·数据结构·笔记·算法·leetcode·宽度优先
A黄俊辉A3 小时前
【无标题】
java
BestHeaker3 小时前
跨企业接口对接:IQDS / CPK 数据解析与协作避坑指南(五)
java·服务器·前端
俊昭喜喜里4 小时前
C#中的func<>
java·前端·c#
highreport4 小时前
net报表工具对比:HighReport 与 FastReport
java·c#
xiaoqiMikko4 小时前
七条 advisory 各给了一个修复版,而一次修完的那个数字一条都没写
java·spring boot
vHelios4 小时前
【电商项目】短信测试遇到的问题与解决方案:InaccessibleObjectException报错、单元测试通过但未接收到验证码
java·微服务