import java.io.*;
public class equals
{
public static void main(String []args)
{
String str,str1;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
System.out.println("Enter another String ");
str1=cin.readLine();
if(str.equals(str1))
{
System.out.println(str+" &"+str1+" both string are equal ");
}
else
{
System.out.println(str+" &"+str1+" both string are not equal ");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
public class equals
{
public static void main(String []args)
{
String str,str1;
try
{
DataInputStream cin=new DataInputStream(System.in);
System.out.println("Enter first String ");
str=cin.readLine();
System.out.println("Enter another String ");
str1=cin.readLine();
if(str.equals(str1))
{
System.out.println(str+" &"+str1+" both string are equal ");
}
else
{
System.out.println(str+" &"+str1+" both string are not equal ");
}
}
catch(Exception e)
{
System.out.println(e);
}
}
}
No comments:
Post a Comment