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

相关推荐
豆奶特浓66 分钟前
谢飞机勇闯Java面试:从内容社区的缓存一致性到AI Agent,这次能飞多高?
java·微服务·ai·面试·架构·缓存一致性·feed流
Pou光明7 分钟前
7_线程安全_线程间的内存可视性2缓存_内存屏障_读写排序
java·开发语言·缓存
CV_J11 分钟前
L12_用户菜单权限
java
来旺12 分钟前
互联网大厂Java面试实战:核心技术栈与业务场景深度解析
java·spring boot·docker·kubernetes·mybatis·hibernate·microservices
big-seal14 分钟前
XML解释
xml·java·数据库
m***119021 分钟前
Spring BOOT 启动参数
java·spring boot·后端
小石头 1008623 分钟前
【JavaEE】synchronized关键字
java·java-ee
悟空码字24 分钟前
Java实现接口幂等性:程序员的“后悔药”
java·后端
天天摸鱼的java工程师25 分钟前
🔍 MySQL 索引底层原理与 SQL 优化实战:从 B + 树到亿级查询优化
java·后端
IMPYLH28 分钟前
Lua 的 select 函数
java·开发语言·笔记·后端·junit·游戏引擎·lua