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

相关推荐
XiYang-DING3 小时前
【Java SE】数据类型、变量、类型转换、运算符以及程序逻辑控制
java·开发语言
闻哥3 小时前
Redis 避坑指南:从命令到主从的全链路踩坑实录
java·数据库·redis·缓存·面试·springboot
Jinkxs4 小时前
基于 Java 的消息队列选型年度总结:RabbitMQ、RocketMQ、Kafka 实战对比
java·kafka·java-rocketmq·java-rabbitmq
独自破碎E4 小时前
JDK版本的区别
java·开发语言
悟空码字5 小时前
SpringBoot深度整合高德地图,构建高性能位置服务
java·springboot·高德地图·编程技术·后端开发
千金裘换酒5 小时前
栈和队列定义及常用语法 LeetCode
java·开发语言
0x535 小时前
JAVA|智能无人机平台(二)
java·开发语言·无人机
JH30735 小时前
SpringBoot自定义启动banner:给项目加个专属“开机画面”
java·spring boot·后端
假女吖☌6 小时前
限流算法-redis实现与java实现
java·redis·算法
lixin5565566 小时前
基于迁移学习的图像风格增强器
java·人工智能·pytorch·python·深度学习·语言模型