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

相关推荐
码王吴彦祖几秒前
顶象 AC 纯算法迁移实战:从补环境到纯算的完整拆解
java·前端·算法
开心码农1号38 分钟前
Java rabbitMQ如何发送、消费消息、全套可靠方案
java·rabbitmq·java-rabbitmq
蜡台1 小时前
JetBrains IDEA 安装 卸载相关总结
java·ide·intellij-idea·注册码
WJLSH1231 小时前
TomCat
java·tomcat
戮戮1 小时前
Spring Cloud Gateway 零拷贝参数校验:一种高性能网关架构实践
java·网络·架构·gateway
alengan2 小时前
cocos自动编译-Android自动出apk包
java·eclipse
漫霂2 小时前
二叉树的统一迭代遍历
java·算法
文静小土豆2 小时前
K8s 滚动更新在 Java 应用中的实践与优化
java·容器·kubernetes
HSunR2 小时前
java springboot3 后端 基础框架
java·开发语言
七夜zippoe2 小时前
Java技术未来展望:GraalVM、Quarkus、Helidon等新趋势探讨
java·开发语言·python·quarkus·graaivm·helidon