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

相关推荐
hnlucky3 分钟前
Windows 上安装下载并配置 Apache Maven
java·hadoop·windows·学习·maven·apache
forestsea1 小时前
Maven 插件扩展点与自定义生命周期
java·maven
keke102 小时前
Java【14_2】接口(Comparable和Comparator)、内部类
java·开发语言
CN.LG2 小时前
Java 乘号来重复字符串的功能
java·开发语言
萌新下岸多多关照2 小时前
Java中synchronized 关键字
java·开发语言
中国lanwp2 小时前
使用Maven部署WebLogic应用
java·maven
开开心心就好2 小时前
Word图片格式调整与转换工具
java·javascript·spring·eclipse·pdf·word·excel
CGG923 小时前
【单例模式】
android·java·单例模式
苦学编程的谢3 小时前
多线程代码案例-1 单例模式
java·开发语言·单例模式
yaoxin5211233 小时前
80. Java 枚举类 - 使用枚举实现单例模式
java·开发语言·单例模式