Java.lang.Character.Subset Class in Java Last Updated : 13 Sep, 2023 Summarize Comments Improve Suggest changes Share 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 Next Article Java.lang.Character.UnicodeBlock Class in Java M Mohit Gupta Improve Article Tags : Java Java-lang package Practice Tags : Java Similar Reads Java.lang.Character.UnicodeBlock Class in Java Character.UnicodeBlock Class represents particular Character blocks of the Unicode(standards using hexadecimal values to express characters - 16 bit) specifications. Character Blocks define characters used for specific purpose. Declaration : public static final class Character.UnicodeBlock extends C 2 min read java.lang.Character Class Methods | Set 1 java.lang.Character Class wraps the value of a primitive data type char to an object of datatype Character. This object contains a single field having the data type char. This class provides several methods regarding character manipulations like converting them from lowercase to uppercase. Character 6 min read java.lang.Character class - methods | Set 2 In Java, the Character Class wraps the value of a primitive data type char into an object of datatype Character. This object contains a single field having the data type char. This class provides several methods regarding character manipulations, like converting them from lowercase to uppercase. Cha 6 min read Java.lang.String class in Java | Set 2 Java.lang.String class in Java | Set 1 In this article we would be discussing different constructor and methods provided by java.lang.String. Strings in java are immutable. Now lets discuss some of the methods provided by String class. Methods: public int codePointAt(int index) - It takes as paramet 5 min read java.nio.charset.Charset Class in Java In Java, Charset is a mapping technique used in Java to map the 16-bit Unicode sequence and sequences of bytes. It is also used to encode and decode the string data text into different character encoding. It comes under java.nio.charset.Charset package. The charset must begin with a number or letter 2 min read java.nio.charset.CharsetEncoder Class in Java For the purpose of character encoding and decoding, java offers a number of classes in the 'java.nio.charset' package. The 'CharsetEncoder' class of this package performs the important task of encoding. In this article, let us understand this class, its syntax, different methods, and some examples o 6 min read Like