Advertisements
Advertisements
प्रश्न
Write a program for the following.
Input two strings and verify whether they are same or not.
कोड लेखन
Advertisements
उत्तर
importjava.util.*;
class clTask
{
void main()
{
String s1, s2;
Scanner sc = new Scanner(System.in);
System.out.println(" Enter 1st string: ");
s1 = sc.nextLine();
System.out.println( " Enter 2nd string : ");
s2 = sc.nextLine();
if(s1.equals(s2))
{
System.out.println("Equal ");
}
else
{
System.out.println("Not Equal ");
}
}
}shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
