System.out.println(args[0] == "x");
System.out.println(args[0].equals("x"));
String[] name = {"x"};
System.out.println(name[0] == "x");
System.out.println(name[0].equals("x"));
String[] hello = new String[1];
hello[0] = "x";
System.out.println(hello[0] == "x");
System.out.println(hello[0].equals("x"));
results in
false
true
true
true
true
true
Why does the first test result in 'false' when I invoke "java classname x"?