jeudi 16 avril 2015

Java command line argument test

When I run the following code



public class Test {
public static void main(String[] args) {
System.out.println(args[0]);
System.out.println("testing");
System.out.println(args[0] == "testing");
}
}


using



java Test testing



at the command line, it prints the following:


testing

testing

false


Why is the third printed line not 'true' when printed lines 1 and 2 seem to be the same?


Aucun commentaire:

Enregistrer un commentaire