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

相关推荐
学长毕设1 小时前
基于SpringBoot的野生动物公益保护平台设计与实现-附源码
java·spring boot·后端
SL_staff1 小时前
离散制造排程破局:JVS-APS 四步闭环落地实践(开发者视角)
java·产品·全栈
这个昵称不容易2 小时前
SpringBoot 美容院管理系统:232个Java文件315个接口,5套角色从预约到发货一整条链路
java·springboot·毕设
装不满的克莱因瓶2 小时前
【SpringAI Alibaba】ReactAgent记忆管理MessageTrimmingHook与MessageDeletionHook
java·人工智能·ai·ai编程·springai·springaialibaba
文丑颜不良啊3 小时前
LeetCode2241~2260题目解析
java·leetcode
文丑颜不良啊3 小时前
LeetCode2321~2340题目解析
java·leetcode
驭渊的小故事3 小时前
Spring AOP 核心概念与通知类型详解
java·后端·spring
vipxieliang3 小时前
ValidX vs 手写验证代码:开发效率对比实测
java·spring boot·后端
vipxieliang4 小时前
虚拟线程与 GraalVM:Spring Boot 3.x 云原生性能跃迁
java·spring boot·后端
Rain的Java大神之路4 小时前
面试官最烦的答案:“我用 Redis + Token”!接口幂等 8 种方案 + 四层防御,把重复扣款工单干到 0
java·后端·面试