‘<>‘ 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 分钟前
神领物流面试题(一)
java·大数据·中间件
云烟成雨TD2 分钟前
Agent Scope Java 2.x 系列【9】接入高德 MCP 服务
java·人工智能·agent
gaohe26AIliuzeyu21 分钟前
Java内部类
java·开发语言
西安邮电大学24 分钟前
有关数组的经典算法题
java·后端·其他·算法·面试
互联网推荐官28 分钟前
上海AI Agent智能体开发公司技术选型实录:六条路径、三类架构与真实落地约束
java·人工智能·ai·架构·开发经验·上海
mikasa66735 分钟前
关于Spring MVC 基于 AOP 实现的全局控制器统一处理方案@ControllerAdvice
java·spring·mvc
一 乐37 分钟前
幼儿园管理系统|基于springboot + vue幼儿园管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·幼儿园管理系统
Bat U38 分钟前
JavaEE|SpringMVC
java·java-ee
摇滚侠42 分钟前
SpringMVC 入门到实战 SpringMVC 的执行流程 96
java·后端·spring·maven·intellij-idea
唐青枫44 分钟前
Java Liquibase 实战指南:让数据库变更像代码一样可追踪
java