Java.lang.Character.Subset Class in Java Last Updated : 13 Sep, 2023 Comments Improve Suggest changes Like Article Like Report Character.Subset Class represents particular subsets of the Unicode(standards using hexadecimal values to express characters - 16bit) character set. The subset, it defines in Character set is UnicodeBlock. Declaration : public static class Character.Subset extends Object Constructors : protected Character.Subset(String str) : Constructs new subset instance. Methods: equals() : java.lang.Character.Subset.equals() tells whether the two Subset Object are equal or not. Syntax : public final boolean equals(Object o) Parameters : o : object to be compare with. Return : true : if o equals argumented object, else false. hashCode() : java.lang.Character.Subset.hashCode() returns the hashCode value of the Subset.. Syntax : public final int hashCode() Parameters : --- Return : hashCode of the argumented object. toString(): java.lang.Character.Subset.toString() returns name of the Subset. Syntax : public final String toString() Parameters : --- Return : string representation of the argumented object. Java // Java Program illustrating the use of Character.Subset class Methods. import java.lang.*; public class CharacterSubsetDemo extends Character.Subset { CharacterSubsetDemo(String s) { // Use of super keyword : // Invokes immediate parent class constructor. super(s); } public static void main(String[] args) { // Initializing two Subsets. CharacterSubsetDemo a = new CharacterSubsetDemo("geeks"); CharacterSubsetDemo b = new CharacterSubsetDemo("for"); // use of equals() : boolean check2 = a.equals(a); System.out.println("Is a equals a ? : " + check2); check2 = b.equals(a); System.out.println("Is b equals a ? : " + check2); System.out.println(); // Use of hashCode() : int check1 = a.hashCode(); System.out.println("hashCode " + a + " : " + check1); check1 = b.hashCode(); System.out.println("hashCode " + b + " : " + check1); System.out.println(); // Use of toString() : System.out.println("a : " + a.toString()); System.out.println("b : " + b.toString()); } } Output : Is a equals a ? : true Is b equals a ? : false hashCode geeks : 366712642 hashCode for : 1829164700 a : geeks b : for Note : lang.Character.Subset Class inherits others methods from java.lang.Object class. For details about java.lang.Object, refer : Object class in Java. Comment More infoAdvertise with us M Mohit Gupta Improve Article Tags : Java Java-lang package Practice Tags : Java Explore BasicsIntroduction to Java4 min readJava Programming Basics9 min readJava Methods7 min readAccess Modifiers in Java6 min readArrays in Java9 min readJava Strings8 min readRegular Expressions in Java7 min readOOPs & InterfacesClasses and Objects in Java10 min readJava Constructors10 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages7 min readJava Interface11 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java6 min readIterator in Java5 min readJava Comparator Interface6 min readException HandlingJava Exception Handling8 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial15+ min readSynchronization in Java10 min readFile Handling in Java5 min readJava Method References9 min readJava 8 Stream Tutorial15+ min readJava Networking15+ min readJDBC Tutorial12 min readJava Memory Management4 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples8 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions7 min readJava Quiz | Level Up Your Java Skills1 min readTop 50 Java Project Ideas For Beginners and Advanced [Update 2025]15+ min read Like