java.lang.Character.Subset.equals()


java.lang.Character.Subset.equals()

package com.codingdict;



import java.lang.*;



public class CharacterSubsetDemo extends Character.Subset {



   // constructor of super class

   CharacterSubsetDemo(String s) {

      super(s); 

   }



   public static void main(String[] args) {



      CharacterSubsetDemo obj1 = new CharacterSubsetDemo("admin");

      CharacterSubsetDemo obj2 = new CharacterSubsetDemo("webmaster");

      CharacterSubsetDemo obj3 = new CharacterSubsetDemo("administrator");



      // compares Subset objects for equality

      boolean retval = obj1.equals(obj1);

      System.out.println("Object obj1 is equal to obj1 ? " + retval);

      retval = obj2.equals(obj1);

      System.out.println("Object obj1 is equal to obj2 ? " + retval);

      retval = obj3.equals(obj1);

      System.out.println("Object obj1 is equal to obj3 ? " + retval);

   }

}