String conversion

Description:

Write a java program to check if two strings are identical or not identical Test Case 1 Input (stdin) java sir Expected Output not identical Test Case 2 Input (stdin) sir sir Expected Output identical

Program :


import java.util.Scanner;

public class TestClass {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

       String a,b;

       a=in.next();

       b=in.next();

       if(a.equals(b))

       {

         System.out.print("identical");

         

       }

       else

       {

         System.out.print("not identical");

       }

}

}