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

相关推荐
User_芊芊君子16 分钟前
【JavaSE】复习总结
java·开发语言·python
我有一颗五叶草25 分钟前
线程间通信
java·开发语言
我真的是大笨蛋4 小时前
K8S-Pod(下)
java·笔记·云原生·容器·kubernetes
碳水加碳水5 小时前
Java代码审计实战:XML外部实体注入(XXE)深度解析
java·安全·web安全·代码审计
努力也学不会java6 小时前
【设计模式】 原型模式
java·设计模式·原型模式
方渐鸿6 小时前
【2024】k8s集群 图文详细 部署安装使用(两万字)
java·运维·容器·kubernetes·k8s·运维开发·持续部署
学亮编程手记6 小时前
K8S v1.33 版本主要新特性介绍
java·容器·kubernetes
Haven-7 小时前
Java-面试八股文-JVM篇
java·jvm·面试
我真的是大笨蛋8 小时前
JVM调优总结
java·jvm·数据库·redis·缓存·性能优化·系统架构
wjs0408 小时前
Git常用的命令
java·git·gitlab