Java 插入“)&引用;在将新HashMap作为参数时完成表达式错误
我得到错误:Java 插入“)&引用;在将新HashMap作为参数时完成表达式错误,java,hashmap,Java,Hashmap,我得到错误:语法错误,插入“)”以在尝试执行此操作时完成表达式: public interface IConectorT extends Library { HashMap<String, String> xx= new HashMap<>(); IConectorT INSTANCE = (IConectorT) Native.loadLibrary("Eloqua API", IConectorT.class, new HashMap{{ put("De
语法错误,插入“)”以在尝试执行此操作时完成表达式
:
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");
}});
}
公共接口IConnect扩展库{
HashMap xx=新的HashMap();
IConnectort实例=(IConnectort)Native.loadLibrary(“Eloqua API”,IConnectort.class,新建
哈希映射{{
放置(“DeleteCustomObjectRecord”DeleteCustomObjectRecord@8");
}});
}
为什么呢?我认为这是因为它不是JRE 1.7,但改为JRE 1.7没有帮助。HashMap构造函数缺少括号
new HashMap{{
应该是
new HashMap(){{
HashMap构造函数缺少括号
new HashMap{{
应该是
new HashMap(){{
有时,由于格式不好,我的head编译器忽略了这样明显的东西。你的头脑显然比我强+1有时,由于格式不好,我的head编译器忽略了这样明显的东西。你的头脑显然比我强+1