
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java.lang.Character.UnicodeBlock.forName() Method
Description
The java.lang.Character.UnicodeBlock.forName() method returns the UnicodeBlock with the given name. Block names are determined by The Unicode Standard.This method accepts block names in the following forms −
Canonical block names as defined by the Unicode Standard. For example, the standard defines a "Basic Latin" block.
Canonical block names with all spaces removed. For example, "BasicLatin" is a valid block name for the "Basic Latin" block.
The text representation of each constant UnicodeBlock identifier. For example, this method will return the BASIC_LATIN block if provided with the "BASIC_LATIN" name.
Declaration
Following is the declaration for java.lang.Character.UnicodeBlock.forName() method
public static final Character.UnicodeBlock forName(String blockName)
Parameters
blockName − This is a UnicodeBlock name.
Return Value
This method returns the UnicodeBlock instance identified by blockName.
Exception
IllegalArgumentException − if blockName is an invalid name.
NullPointerException − if blockName is null.
Example
The following example shows the usage of java.lang.Character.UnicodeBlock.forName() method.
package com.tutorialspoint; import java.lang.*; public class CharacterUnicodeBlockDemo { public static void main(String[] args) { // returns the UnicodeBlock instance with blockName "BASIC_LATIN" System.out.println(Character.UnicodeBlock.forName("BASIC_LATIN")); // returns the UnicodeBlock instance with blockName "BasicLatin" System.out.println(Character.UnicodeBlock.forName("BasicLatin")); // returns the UnicodeBlock instance with specified blockName System.out.println(Character.UnicodeBlock.forName("ARABIC")); System.out.println(Character.UnicodeBlock.forName("MUSICALSYMBOLS")); System.out.println(Character.UnicodeBlock.forName("TAMIL")); } }
Let us compile and run the above program, this will produce the following result −
BASIC_LATIN BASIC_LATIN ARABIC MUSICAL_SYMBOLS TAMIL