Please find the code snippet below :
public static void main(String[] args)
{
System.out.println(args[0]=="abc");
}
I am getting the output as false (believe me I am passing abc as command line args i.e. java Main abc from command line) Can somebody explain me the reason behind "false" in the output? what I could conclude is command line args are created on heap,but couldn't find the concrete reason/explanation for the same.I understand String comparison and difference between equals and ==.Are command line args not stored in String pool?