devxlogo

String Comparing

String Comparing

Suppose that you have the following code:

    String strObj;   if(strObj != null)     if(strObj.equals("something")){       //     }

size=3>
You can use instead “something”.equals(strObj), so you don’t have to test if strObj is null.

devx-admin

Share the Post: