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

相关推荐
CHANG_THE_WORLD30 分钟前
指针入门一
java·前端·网络
时艰.32 分钟前
订单系统读写分离方案设计与实现
java
014-code37 分钟前
MySQL 事务隔离级别
java·数据库·mysql
hrhcode1 小时前
【Netty】三.ChannelPipeline与ChannelHandler责任链深度解析
java·后端·spring·springboot·netty
invicinble1 小时前
关于学习技术栈的思考
java·开发语言·学习
json{shen:"jing"}2 小时前
分割回文串-暴力法
java·算法
没有bug.的程序员2 小时前
Maven 进阶进阶:依赖优化内核、多模块构建艺术与“依赖地狱”自愈指南
java·maven·构建·多模块·依赖优化
毕设源码-赖学姐2 小时前
【开题答辩全过程】以 基于Java的外卖点餐网站为例,包含答辩的问题和答案
java·开发语言
追随者永远是胜利者2 小时前
(LeetCode-Hot100)4. 寻找两个正序数组的中位数
java·算法·leetcode·职场和发展·go
追随者永远是胜利者2 小时前
(LeetCode-Hot100)2. 两数相加
java·算法·leetcode·go