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


Post a Comment

Copyright © Rough Record. Designed by OddThemes