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

相关推荐
小羊没烦恼!1 小时前
微服务化的基石——持续集成
java·大数据·word·powerpoint·.net
俊昭喜喜里2 小时前
java中的继承和多态的区别
java
小羊没烦恼!2 小时前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
譕痕2 小时前
JSONObject与JSONArray封装数据格式区别
java·json
胡写代码2 小时前
别再前后端各写一套表单校验了
java·后端
小鱼能吃糖2 小时前
缺陷修复总览 · mall电商项目:5类缺陷,1个病根,4个业务域
java·电商
此时不提桶,更待何时2 小时前
01-06-A-JVM排查实战详解
java·jvm
vipxieliang3 小时前
ValidX 在 DDD 领域驱动设计中的实践
java·spring boot
ba_pi3 小时前
mysql 查询所有表名并授权
java
ProcessOn官方账号4 小时前
java函数式编程--入门基础
java·编程·函数式编程