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

相关推荐
indexsunny2 分钟前
互联网大厂Java面试实战:从Spring Boot到微服务的逐步深入
java·数据库·spring boot·微服务·kafka·监控·安全认证
小光学长8 分钟前
ssm手工艺品交易平台4xccvou1(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
java·数据库·spring
人道领域40 分钟前
【零基础学java】(方法引用)
java·开发语言
路漫聊架构1 小时前
Redis扫描大key利器Scan命令探秘
java·数据库·redis
qq_336313931 小时前
java基础-IO流(打印流)
java·开发语言
我命由我123451 小时前
Android Jetpack Compose - enableEdgeToEdge 函数、MaterialTheme 函数、remember 函数
android·java·java-ee·kotlin·android studio·android jetpack·android-studio
tkevinjd1 小时前
JavaIO流1
java
J_liaty1 小时前
从入门到实战:Java Socket 实现 TCP/UDP 双协议网络通信系统(带心跳检测)
java·tcp/ip·udp
计算机学姐1 小时前
基于SpringBoot的美妆销售系统【个性化推荐算法+数据可视化统计+库存预警+物流信息】
java·vue.js·spring boot·后端·mysql·信息可视化·mybatis
橙熟1 小时前
一次 Druid 慢查询超时问题的源码排查
java