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

相关推荐
星辰_mya4 分钟前
Kafka Producer 发送慢 → TPS 骤降 90%
java·数据库·kafka
网小鱼的学习笔记10 分钟前
leetcode283移动零元素
java·开发语言·算法
自在极意功。11 分钟前
Spring Boot 自动配置原理基本理解
java·spring boot·后端·自动配置原理
一点多余.11 分钟前
java中的单例模式
java·开发语言·单例模式
keyborad pianist19 分钟前
Java应用基础 Day3
java·开发语言
笨蛋不要掉眼泪20 分钟前
从零构建微服务网关:Spring Cloud Gateway 核心原理与实战配置详解
java·微服务·云原生·架构
南部余额25 分钟前
Apache POI 从入门到实战:Excel 与 Word操作攻略
java·word·excel·poi
java1234_小锋27 分钟前
Java高频面试题:怎么实现Redis的高可用?
java·开发语言·redis
笨蛋不要掉眼泪28 分钟前
Spring Cloud Gateway 核心实战:断言(Predicate)的长短写法与自定义工厂详解
java·前端·微服务·架构
A懿轩A29 分钟前
【Maven 构建工具】Maven + JUnit5 单元测试实战:测试级别、注解、断言与 Maven test 阶段
java·单元测试·maven