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

相关推荐
014-code3 分钟前
Java 并发中的原子类
java·开发语言·并发
AI人工智能+电脑小能手6 分钟前
【大白话说Java面试题】【Java基础篇】第29题:静态代理和动态代理的区别是什么
java·开发语言·后端·面试·代理模式
善恶怪客6 分钟前
Java-数组和可变参数
java·开发语言
小编码上说7 分钟前
LSH(局部敏感哈希)分桶,海量数据下的相似性搜索解决方案
java·spring boot·缓存·langchain4j·lsh·局部敏感哈希·ai调用优化
计算机_毕业设计27 分钟前
java-springboot数字藏品系统 基于 SpringBoot 的区块链数字艺术品交易平台 Java 微服务架构下的加密藏品展示与拍卖系统计算机毕业设计
java·spring boot·课程设计
ONVO ncen27 分钟前
Redis6.2.6下载和安装
java
丑八怪大丑29 分钟前
JDK8-17新特性
java·开发语言
京师20万禁军教头40 分钟前
37面向对象(高级)-main方法
java
书源丶41 分钟前
三十五、Java 泛型——类型安全的「万能模板」
java·开发语言·安全
dovens1 小时前
SpringBoot集成MQTT客户端
java·spring boot·后端