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

相关推荐
驭渊的小故事21 分钟前
订单服务如何调用商品服务?一次 RestTemplate 跨服务调用入门
java·开发语言·php
文丑颜不良啊2 小时前
LeetCode3001~3020题目解析
java·leetcode
山楂树の3 小时前
Java 字符串高效处理:StringBuilder、StringBuffer、StringJoiner
java·开发语言
.痞老板.5 小时前
java ee--文件操作和IO
java·java-ee
简 洁 冬冬5 小时前
分页「向上取整」公式 `(total + size - 1) / size` 的完整推导
java·分页
装不满的克莱因瓶7 小时前
【从零搭建】AI大模型之ReactAgent智能体对接MCP实战
java·人工智能·ai·springai·mcp·springaialibaba
SimonKing8 小时前
AI Assistant被"隐藏"了?别慌,IDEA 2026.3 这波是换了个脑子
java·后端·程序员
Resean02238 小时前
SpringMVC 6+源码分析(九)异常处理
java·spring·springmvc
geats人山人海8 小时前
现代c++4.1
java·开发语言·c++
下一站春风里9 小时前
Spring IoC 控制反转 完整技术笔记
java·spring boot·笔记·spring