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

相关推荐
yaoxin52112311 小时前
503. Java 反射 - 编写 ServiceFactory 类
java·开发语言·python
考虑考虑11 小时前
Java三元表达式注意
java·后端·java ee
程序员小八77712 小时前
Java 快速转 Go
java·python·golang
职场的momo12 小时前
11个后端与AI岗位同时开放:Java、网关、推理优化怎么匹配
java·开发语言·人工智能
罗超驿13 小时前
SpringMVC 请求参数接收详解|单个参数、多参数、对象参数、@RequestParam参数重命名
java·后端·postman·javaee
古法安卓14 小时前
Android-epoll原理详解
android·java·android studio
fireworks9914 小时前
接口鉴权(401与403)
java·后端
wear工程师14 小时前
线程池里的异常去哪了?execute 和 submit 不是一回事
java
孔明click3314 小时前
别人绕过我的网关直接调用资源服务怎么办?使用 Sa-Token 解决:网关转发鉴权、RPC调用鉴权
java·sa-token·springboot·权限·权限认证
吴声子夜歌14 小时前
Java面试——设计模式(一)
java·设计模式·面试