| Home | About Us | Portfolio | Services | Courses | Career | Cost | Contact
class strequalsIgnoreCase
{
public static void main(String args[])
r{
String str1,str2,str3,str4;
boolean b;
str1=”welcome”;
str2=”welcome”;
str3=”WELCOME”;
str4=”Hello”;
System.out.println(“Str1=”+str1+”\nStr2=”+str2+”\nStr3=”+str3+”\nStr4=”+str4);
b=str1.equalsIgnoreCase(str2);
if(b=true)
System.out.println(“Str1 is equal to str2”);
else
System.out.println(“Str1 is not equal to str2”);
b=str1.equalsIgnoreCase(str3);
if(b==true)
System.out.println(“Str1 is equal to str3”);
else
System.out.println(“Str1 is not equal to str3”);
b=str1.equalsIgnoreCase(str4);
if(b==true)
System.out.println(“Str1 is equal to str4”);
else
System.out.println(“Str1 is not equal to str4”);
}
}
Us |