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

相关推荐
xing-xing32 分钟前
JVM 内存、直接内存、系统内存、本地内存、物理内存总结
java·jvm
yangpipi-33 分钟前
《C++并发编程实战》第5章 C++内存模型和原子操作
android·java·c++
qq_12498707532 小时前
基于微信小程序的电子元器件商城(源码+论文+部署+安装)
java·spring boot·spring·微信小程序·小程序·毕业设计
吃喝不愁霸王餐APP开发者2 小时前
基于Spring Cloud Gateway实现对外卖API请求的统一鉴权与流量染色
java·开发语言
a努力。2 小时前
美团Java面试被问:Redis集群模式的工作原理
java·redis·后端·面试
一雨方知深秋2 小时前
面向对象编程
java·封装·this·构造器·static关键字·成员变量·javabean实体类
资生算法程序员_畅想家_剑魔2 小时前
Java常见技术分享-11-责任链模式
java·spring boot·责任链模式
计算机程序设计小李同学2 小时前
动漫之家系统设计与实现
java·spring boot·后端·web安全
程序员阿鹏3 小时前
责任链模式
java·spring·servlet·tomcat·maven·责任链模式
@淡 定3 小时前
Java内存模型(JMM)详解
java·开发语言