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

相关推荐
萧瑟余晖34 分钟前
Java深入解析篇十七之Spring Security
java·开发语言·spring
离陌在学C#3 小时前
C# 重载与重写:深入理解面向对象编程的核心概念
java·c#
洛阳泰山3 小时前
AI 应用层被 Python 卷成红海,为什么我偏要用 Java 造一个 RAG + 工作流引擎?
java·人工智能·后端
二十雨辰3 小时前
[Java]-Spring面试题
java·开发语言
老马历写记3 小时前
Maven POM 依赖管理总结
java·maven·system·pom·optional
古法安卓4 小时前
Android-车机 GNSS 定位数据接收问题排查
android·java·android studio
蔬菜_4 小时前
前端转全栈-day5(数组、list、set)
java·前端·数据结构·list
萧瑟余晖4 小时前
Java深入解析篇二十二之虚拟线程
java·开发语言
OuO-24 小时前
笔试强训 Day 34:ISBN 号码、kotori 和迷宫、矩阵最长递增路径
java·算法·矩阵
油丶酸萝卜别吃4 小时前
Java 集合类全景介绍
java·开发语言