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

相关推荐
奋斗的小乌龟7 小时前
动态创建Agent02
java
ZFSS7 小时前
Localization Translate API 集成与使用指南
java·服务器·数据库·人工智能·mysql·ai编程
摇滚侠7 小时前
Java 零基础全套教程,集合框架,笔记 153-163
java·开发语言·笔记
nannan12327 小时前
后端技术栈梳理
java
L、2188 小时前
CANN算子开发调试实战:从“Segmentation Fault“到定位根因的完整流程
java·开发语言
索木木9 小时前
NCCL SHARP 和 TREE算法
java·服务器·算法
NiceCloud喜云9 小时前
Claude Files API 深入:从上传、复用到配额管理的工程化指南
android·java·数据库·人工智能·python·json·飞书
超梦dasgg10 小时前
Java 生产环境 MQ 技术选型全解析
java·开发语言·java-rocketmq·java-rabbitmq
霸道流氓气质10 小时前
Spring AI 多工具链式调用(Tool Chain)极简实战
java·人工智能·spring
罗超驿11 小时前
22.深入剖析JDBC架构:从原生API到企业级数据交互核心
java·数据库·mysql·面试