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

相关推荐
Jelena1577958579232 分钟前
电商运营分析数据比价接口实战:多平台价格监控与智能决策系统
java·大数据·数据库
神明不懂浪漫1 小时前
【第五章】Java中的继承与多态
java·开发语言
AI多Agent协作实战派3 小时前
AI多Agent协作系统实战(十七):凌晨4点,我的AI系统在“假装工作“——3个bug同时爆炸的5小时
java·前端·bug
gaolei_eit4 小时前
Java+Ai+vue
java·spring·maven
qq_2518364574 小时前
基于java Web 动漫视频网站毕业论文
java·开发语言·前端
LayZhangStrive4 小时前
JUC相关的函数、注解、变量杂记
java·面试·多线程·juc
未秃头的程序猿4 小时前
给公司做了个AI客服Agent,用的Spring AI 1.0,3天上线领导拍板了
java·后端·ai编程
曹牧4 小时前
Eclipse 批量文本替换
java·ide·eclipse
程序员清风4 小时前
OpenAI官方发布最新提示词技巧!
java·后端·面试
一只枫林4 小时前
MySQL内、外连接知识点汇总
java·前端·数据库