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

相关推荐
独断万古他化2 分钟前
【Java 网络编程全解】Socket 套接字与 TCP/UDP 通信实战全解
java·网络编程·socket
牧小七5 分钟前
java14的新特性
java
努力努力再努力wz1 小时前
【Linux网络系列】:JSON+HTTP,用C++手搓一个web计算器服务器!
java·linux·运维·服务器·c语言·数据结构·c++
魂梦翩跹如雨1 小时前
死磕排序算法:手撕快速排序的四种姿势(Hoare、挖坑、前后指针 + 非递归)
java·数据结构·算法
带刺的坐椅8 小时前
Solon AI Skills 会是 Agent 的未来吗?
java·agent·langchain4j·solon-ai
jacGJ8 小时前
记录学习--文件读写
java·前端·学习
花间相见9 小时前
【JAVA开发】—— Nginx服务器
java·开发语言·nginx
扶苏-su9 小时前
Java---Properties 类
java·开发语言
cypking9 小时前
四、CRUD操作指南
java
2301_7806698610 小时前
文件字节流输出、文件复制、关闭流的方法
java