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

相关推荐
极客先躯43 分钟前
说说高级java每日一道面试题-2025年2月13日-数据库篇-请说说 MySQL 数据库的锁 ?
java·数据库·mysql·数据库的锁·模式分·粒度分·属性分
程序员侠客行1 小时前
Spring事务原理 二
java·后端·spring
小猫猫猫◍˃ᵕ˂◍1 小时前
备忘录模式:快速恢复原始数据
android·java·备忘录模式
liuyuzhongcc1 小时前
List 接口中的 sort 和 forEach 方法
java·数据结构·python·list
五月茶1 小时前
Spring MVC
java·spring·mvc
sjsjsbbsbsn1 小时前
Spring Boot定时任务原理
java·spring boot·后端
yqcoder1 小时前
Express + MongoDB 实现在筛选时间段中用户名的模糊查询
java·前端·javascript
菜鸟蹦迪2 小时前
八股文实战之JUC:ArrayList不安全性
java
2501_903238652 小时前
Spring MVC配置与自定义的深度解析
java·spring·mvc·个人开发
逻各斯2 小时前
redis中的Lua脚本,redis的事务机制
java·redis·lua