lundi 17 octobre 2016

Java Evaluate IF statement

String groupType="local";

        if(groupType==null ||groupType.equals("")||!groupType.equalsIgnoreCase("local")||!groupType.equalsIgnoreCase("global")||!groupType.equalsIgnoreCase("universal")){
              System.out.print("evlauate to true ");

        }

Why does this code evaluate to true, !groupType.equalsIgnoreCase("local") should set it to false ,

Aucun commentaire:

Enregistrer un commentaire