import java.util.Scanner; public class Main { public static void main(String args[]) { String s1,s2; Scanner sc=new Scanner(System.in); System.out.print("Enter String 1 : "); s1=sc.nextLine(); System.out.print("Enter String 2 : "); s2=sc.nextLine(); int n=s1.equalsIgnoreCase((s2); if(n==0) { System.out.println("Both are equal"); } else { System.out.println("Both are not equal"); } } }
Enter String 1 : Sateesh
Enter String 2 : SATEESH
Both are equal