10 April 2012

explanation about the equalsIgnoreCase( ) method of String class.



public class Test_java{
  public static void main(String args[]){
 String string1 = "faizal";
 String string2 = "faizal ps";
 String string3 = "FAizal";
 boolean test1 = string1.equalsIgnoreCase(string2);
 boolean test2 = string1.equalsIgnoreCase(string3);
   System.out.println(string1+ " equals " + string2+ " :" + test1);
   System.out.println(string1+ " equals " + string3+ " :" + test2);
  }
}

output


faizal equals faizal ps :false
faizal equals FAizal :true


0 comments:

Post a Comment

Related Posts with Thumbnails

Popular Posts

 
;