Compare with the following code:
String pingResult = "asd";
long s = System.nanoTime ( );
if ( null != pingResult )
{
System.out.println ( "null != pingResult" );
}
long e = System.nanoTime ( );
System.out.println ( e - s );
long s1 = System.nanoTime ( );
if ( pingResult != null )
{
System.out.println ( "pingResult != null" );
}
long e1 = System.nanoTime ( );
System.out.println ( e1 - s1 );
null != pingResult
325737
pingResult != null
47027
Therefore, pingResult != null
is the winner.