This application:
class Method4
{
public static void main( String[] args )
{
System.out.println( "args[0] = " + args[0] );
System.out.println( "args[1] = " + args[1] );
if (args[1] == "test1")
{
System.out.println( "args[1] using if statement= " + args[1] );
}
}
}
Executing with this line:
>java Method4 test0 test1
yields this output:
args[0] = test0
args[1] = test1
Question: Why is the if statement false?