java.lang.Character.equals(Object obj)


java.lang.Character.equals(Object obj)

package com.codingdict;



import java.lang.*;



public class CharacterDemo {



   public static void main(String[] args) {



      // create 2 Character objects c1, c2

      Character c1, c2;



      // create a boolean primitive res

      boolean res;



      // assign values to c1, c2

      c1 = new Character('a');

      c2 = new Character('A');



      // assign the result of equals method on c1, c2 to res

      res = c1.equals(c2);



      String str = c1+ " and " + c2 + " are equal is " + res;



      // print res value

      System.out.println( str );

   }

}