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

相关推荐
高山上有一只小老虎16 小时前
构造A+B
java·算法
学困昇16 小时前
C++中的异常
android·java·c++
MC丶科16 小时前
Java设计模式漫画英雄宇宙-工厂模式 —Factory博士的“超级英雄制造机”!
java·设计模式·漫画
虎子_layor16 小时前
告别Redis瓶颈:Caffeine本地缓存优化实战指南
java·后端
q***985216 小时前
什么是Spring Boot 应用开发?
java·spring boot·后端
带刺的坐椅16 小时前
Solon AI 开发学习4 - chat - 模型实例的构建和简单调用
java·ai·chatgpt·solon
hadage23316 小时前
--- JavaScript 的一些常用语法总结 ---
java·前端·javascript
懂得节能嘛.17 小时前
【Java动态线程池】Redis监控+动态调参
java·开发语言·redis
豆奶特浓617 小时前
Java面试模拟:当搞笑程序员谢飞机遇到电商秒杀与AIGC客服场景
java·spring boot·微服务·面试·aigc·高并发·电商
明洞日记17 小时前
【设计模式手册013】命令模式 - 请求封装的优雅之道
java·设计模式·命令模式