Character constants in Java Part -VII

Some of the constants of the Character class in Java.

1. Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING

Syntax:

byte java.lang.Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING: 16

Strong bidirectional character type "RLE" in the Unicode specification.

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {

        System.out.println(Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING);

    }
}

Output:

16


2. Character.DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE

Syntax:

byte java.lang.Character.DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE: 20

Weak bidirectional character type "RLI" in the Unicode specification. 

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {
        System.out.println(Character.DIRECTIONALITY_RIGHT_TO_LEFT_ISOLATE);

    }
}

Output:

20


3. Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE

Syntax:

byte java.lang.Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE: 17

Strong bidirectional character type "RLO" in the Unicode specification.

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {

        System.out.println(Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE);

    }
}

Output:

17


4. Character.DIRECTIONALITY_SEGMENT_SEPARATOR

Syntax:

byte java.lang.Character.DIRECTIONALITY_SEGMENT_SEPARATOR: 11

Neutral bidirectional character type "S" in the Unicode specification.

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {

        System.out.println(Character.DIRECTIONALITY_SEGMENT_SEPARATOR);

    }
}

Output:

11


5. Character.DIRECTIONALITY_UNDEFINED

Syntax:

byte java.lang.Character.DIRECTIONALITY_UNDEFINED: -1

Undefined bidirectional character type. Undefined char values have undefined directionality in the Unicode specification.

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {

        System.out.println(Character.DIRECTIONALITY_UNDEFINED);

    }
}

Output:

-1


6. Character.DIRECTIONALITY_WHITESPACE

Syntax:

byte java.lang.Character.DIRECTIONALITY_WHITESPACE: 12

Neutral bidirectional character type "WS" in the Unicode specification.

Approach

Java

public class CharacterConstants5 {
    public static void main(String[] args) {
        System.out.println(Character.DIRECTIONALITY_WHITESPACE);

    }
}

Output:

12


7. Character.SPACE_SEPARATOR

Syntax:

byte java.lang.Character.SPACE_SEPARATOR: 12

General category "Zs" in the Unicode specification.

Approach

Java

public class CharacterConstants9 {
    public static void main(String[] args) {

        System.out.println(Character.SPACE_SEPARATOR);

    }
}

Output:

12


8. Character.START_PUNCTUATION

Syntax:

byte java.lang.Character.START_PUNCTUATION : 21

General category "Ps" in the Unicode specification.

Approach

Java

public class CharacterConstants9 {
    public static void main(String[] args) {

        System.out.println(Character.START_PUNCTUATION);

    }
}

Output:

21


9. Character.SURROGATE

Syntax:

byte java.lang.Character.SURROGATE: 19

General category "Cs" in the Unicode specification. 

Approach

Java

public class CharacterConstants9 {
    public static void main(String[] args) {
        System.out.println(Character.SURROGATE);

    }
}

Output:

19


Some more constants of Character class:


Character constants Part -I


Character constants Part -II


Character constants Part -III


Character constants Part - IV


Character constants Part -V


Character constants Part -VI


Character constants Part -VIII

No comments:

Post a Comment