我试图在eclipse中的调试会话期间初始化变量Set<String>
。所以,我在可变右键单击要更改,并在“更改对象值”窗口中键入以下公式:如何在eclipse中调试期间初始化HashSet变量?
new HashSet<String>(Arrays.asList(new String[]{"a", "b"}));
Eclipse中返回以下错误:
HashSet cannot be resolved to a type
Arrays cannot be resolved
有没有什么办法来初始化在eclipse中调试会话期间收集?
请注意,您不需要显式数组创建:'Arrays.asList(“a”,“b”)'工作原理相同。 –