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

相关推荐
独自破碎E8 分钟前
Java对象是怎么在虚拟机中存储的?
java·开发语言
兮动人23 分钟前
打破 OS 壁垒:Java 跨平台硬件信息采集的“终极方案”
java·开发语言
json{shen:"jing"}38 分钟前
07_表单输入绑定
java·前端·javascript
zhaokuner1 小时前
12-深层模型与重构-DDD领域驱动设计
java·开发语言·设计模式·架构
weixin_440730501 小时前
java面向对象OPP-三大特性
java·开发语言·python
No芒柠Exception2 小时前
Spring Boot 实现分片上传、断点续传与进度条
java·后端
k***92162 小时前
如何在C++的STL中巧妙运用std::find实现高效查找
java·数据结构·c++
君爱学习2 小时前
Spring AI简介
java
EnzoRay2 小时前
注解
java
宇宙之大,无奇不有(一个玩暗区的人)2 小时前
[NOIP 2011 普及组]T1 数字反转
java·开发语言·算法