gpt4 book ai didi

java - Insert ")"to complete Expression error while new HashMap as parameter

转载 作者:行者123 更新时间:2023-11-29 07:01:19 25 4
gpt4 key购买 nike

我收到错误:Syntax error, insert ")"to complete Expression 当我尝试这样做时:

public interface IConectorT extends Library {
HashMap<String, String> xx= new HashMap<>();
IConectorT INSTANCE = (IConectorT) Native.loadLibrary("Eloqua API", IConectorT.class, new
HashMap{{
put("DeleteCustomObjectRecord", "DeleteCustomObjectRecord@8");
}});
}

这是为什么呢?我认为这是因为它不是 JRE 1.7,但更改为 JRE 1.7 没有帮助。

最佳答案

HashMap 构造函数缺少括号

new HashMap{{

应该是

 new HashMap(){{

关于java - Insert ")"to complete Expression error while new HashMap as parameter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25601544/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com