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

相关推荐
南城以南溫暖如初14710 分钟前
社群电商实战指南:从零搭建高转化社区的技术架构
java·spring boot·mysql·系统架构·vue·mybatis
南城以南溫暖如初14711 分钟前
会员返利商城系统开发实战:架构设计与实现指南
java·spring boot·mysql·vue·mybatis
Shaoshing22 分钟前
Java SE Java EE 和 JavaME区别
java
lhldsg37 分钟前
树洞倾诉的核心需求与产品定位误区
java·前端·小程序
Freak嵌入式1 小时前
MicroPython+Pico 接收空闲中断和发送空闲中断全实战
java·开发语言·stm32·单片机·嵌入式硬件
计算机毕设定制辅导-无忧学长1 小时前
《基于SpringBoot的图书管理系统设计与实现》
java·spring boot·后端
小蒜学长1 小时前
借助于大模型工具Cursor的中药材交易系统的设计与实现(代码+数据库+LW)
java·数据库·spring boot·后端
Arvin6271 小时前
SonarQube 扫描 Maven 项目编译错误
java·maven·sonar
lhldsg1 小时前
宠物同城领养平台开发实战:从需求分析到上线部署指南
java·前端·小程序·需求分析·宠物
风萧萧19991 小时前
JAVA :JSONObject转换为XML
xml·java·python