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

相关推荐
zww89491114 小时前
相册印刷项目实战指南:从设计到成品的完整技术流程
java·小程序·eclipse
程序猫.4 小时前
双指针问题
java·数据结构·算法
拾光Ծ4 小时前
【MySQL】复合查询、表的连接
java·数据库·sql·mysql
MetaLite4 小时前
Java通用枚举驱动下拉框-元数据接口与前端契约
java·前端·状态模式
文子越来越强4 小时前
线程池使用总结
java
SimonKing4 小时前
Java 图片处理还在用 ImageIO?这个库让你代码从 30 行变 3 行
java·后端·程序员
数据狐(Datafox)4 小时前
mercadolibre.item_get 工程实战:美客多商品详情API技术解析与落地应用
java·人工智能·mysql·json
~木雨4 小时前
Java 内部类系列④(收官):内部类底层与版本演进全梳理 —— 合成字段、nestmates 与 JDK18 优化,附全套面试背诵表
java·字节码·内部类·java 面试·nestmates·jdk18
吴声子夜歌5 小时前
Guava——反射
java·开发语言·guava
X1A0RAN5 小时前
Jenkins 流水线跨阶段的数据共享:让变量“动态更新“成为可能
java·servlet·jenkins