![java package tutorial](/java/lang/images/java.jpg)
- Java.lang Package classes
- Java.lang - Home
- Java.lang - Boolean
- Java.lang - Byte
- Java.lang - Character
- Java.lang - Character.Subset
- Java.lang - Character.UnicodeBlock
- Java.lang - Class
- Java.lang - ClassLoader
- Java.lang - Compiler
- Java.lang - Double
- Java.lang - Enum
- Java.lang - Float
- Java.lang - InheritableThreadLocal
- Java.lang - Integer
- Java.lang - Long
- Java.lang - Math
- Java.lang - Number
- Java.lang - Object
- Java.lang - Package
- Java.lang - Process
- Java.lang - ProcessBuilder
- Java.lang - Runtime
- Java.lang - RuntimePermission
- Java.lang - SecurityManager
- Java.lang - Short
- Java.lang - StackTraceElement
- Java.lang - StrictMath
- Java.lang - String
- Java.lang - StringBuffer
- Java.lang - StringBuilder
- Java.lang - System
- Java.lang - Thread
- Java.lang - ThreadGroup
- Java.lang - ThreadLocal
- Java.lang - Throwable
- Java.lang - Void
- Java.lang Package extras
- Java.lang - Interfaces
- Java.lang - Errors
- Java.lang - Exceptions
- Java.lang Package Useful Resources
- Java.lang - Useful Resources
- Java.lang - Discussion
Java Character.UnicodeBlock of(int codePoint) Method
Description
The Java Character.UnicodeBlock of(int codePoint) method returns the object representing the Unicode block containing the given character (Unicode code point), or null if the character is not a member of a defined block.
Declaration
Following is the declaration for java.lang.Character.UnicodeBlock.of() method
public static Character.UnicodeBlock of(int codePoint)
Parameters
codePoint − This is the character (Unicode code point).
Return Value
This method returns the UnicodeBlock instance representing the Unicode block of which this character is a member, or null if the character is not a member of any Unicode block.
Exception
IllegalArgumentException − if the specified codePoint is an invalid Unicode code point.
Getting UnicodeBlock of BASIC_LATIN Example
The following example shows the usage of Java Character.UnicodeBlock of() method. We're using of() method to get UnicodeBlock of BASIC_LATIN using 20.
package com.tutorialspoint; public class CharacterUnicodeBlockDemo { public static void main(String[] args) { // returns the UnicodeBlock by specifying codePoint System.out.println(Character.UnicodeBlock.of(20)); } }
Let us compile and run the above program, this will produce the following result −
BASIC_LATIN
Getting UnicodeBlock of GREEK Example
The following example shows the usage of Java Character.UnicodeBlock of() method. We're using of() method to get UnicodeBlock of GREEK using 1009 and 999.
package com.tutorialspoint; public class CharacterUnicodeBlockDemo { public static void main(String[] args) { // returns the UnicodeBlock by specifying codePoint System.out.println(Character.UnicodeBlock.of(1009)); System.out.println(Character.UnicodeBlock.of(999)); } }
Let us compile and run the above program, this will produce the following result −
GREEK GREEK
Getting UnicodeBlock of CJK_SYMBOLS_AND_PUNCTUATION Example
The following example shows the usage of Java Character.UnicodeBlock of() method. We're using of() method to get UnicodeBlock of CJK_SYMBOLS_AND_PUNCTUATION using 12345.
package com.tutorialspoint; public class CharacterUnicodeBlockDemo { public static void main(String[] args) { // returns the UnicodeBlock by specifying codePoint System.out.println(Character.UnicodeBlock.of(12345)); } }
Let us compile and run the above program, this will produce the following result −
CJK_SYMBOLS_AND_PUNCTUATION