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

相关推荐
像我这样帅的人丶你还8 小时前
Java 后端详解(四):分页与搜索
java·javascript·后端
她的男孩8 小时前
数据权限为什么不能只靠注解?Forge 的 Mapper 层 SQL 改写源码拆解
java·后端·架构
tntxia9 小时前
Mybatis的日志输入
java
亦暖筑序10 小时前
Java 8老系统Browser Agent实战:三层拦截把AI操作后台变成可审计流程
java·后端·设计模式
用户2986985301413 小时前
Java 实现 Word 文档加密与权限解除
java·后端
Yeats_Liao14 小时前
14:Servlet中的页面跳转-Java Web
java·后端·架构
未秃头的程序猿14 小时前
告别"if-else地狱"!Java 21模式匹配,代码优雅了10倍
java·后端·面试
鹤望兰67514 小时前
字节跳动国际支付-后端开发-三面面经
java
Flittly15 小时前
【AgentScope Java新手村系列】(14)人机交互
java·spring boot·spring
RainCity15 小时前
Java Swing 自定义组件库分享(十二)
java·笔记·后端