我试图为node.js安装xml2json包但它给了我错误.
我的系统配置如下:
node.js版本 - v5.4.1
npm版本 - 3.3.12
操作系统 - Windows 10 64位
python - 2.7.11(设置为环境变量)
安装microsoft windows sdk v7.1后,它给出了我的错误.
添加package.json后,会给出错误.
首先在HashSet中添加元素并打印HashSet的大小,该大小按预期返回.但我修改了一个对象值并再次存储到HashSet并使用对象名称删除对象.但我仍然和以前一样大小.我的代码如下:
public class Test {
private String s;
public Test(String s){
this.s = s ;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
HashSet<Object> hs = new HashSet<Object>();
Test t1 = new Test("Keval");
Test t2 = new Test("Keval");
String s1 = new String("Keval");
hs.add(t1);
hs.add(t2);
hs.add(s1);
System.out.println("Set Size :: " + hs.size());
s1 = new String("Demo");
hs.remove(s1);
System.out.println("Set Size :: " + hs.size());
}
}
Run Code Online (Sandbox Code Playgroud)
上述代码的输出是:
Set Size :: 3
Set Size :: 3 // Why …Run Code Online (Sandbox Code Playgroud)