Character constants in Java Part -VIII

Some of the constants of the Character class in Java.

1. Character.ENCLOSING_MARK

Syntax:

byte java.lang.Character.ENCLOSING_MARK: 7

General category "Me" in the Unicode specification.

Java

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

        System.out.println(Character.ENCLOSING_MARK);
    }
}

Output:

7


2. Character.END_PUNCTUATION

Syntax:

byte java.lang.Character.END_PUNCTUATION: 22

General category "Pe" in the Unicode specification.

Java

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

        System.out.println(Character.END_PUNCTUATION);

    }
}

Output:

22


3. Character.FINAL_QUOTE_PUNCTUATION

Syntax:

byte java.lang.Character.FINAL_QUOTE_PUNCTUATION: 30

General category "Pf" in the Unicode specification.

Java

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

        System.out.println(Character.FINAL_QUOTE_PUNCTUATION);

    }
}

Output:

30


4. Character.FORMAT

Syntax:

byte java.lang.Character.FORMAT: 16

General category "Cf" in the Unicode specification.

Java

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

    System.out.println(Character.FORMAT);

    }
}

Output:

16


5. Character.INITIAL_QUOTE_PUNCTUATION

Syntax:

byte java.lang.Character.INITIAL_QUOTE_PUNCTUATION: 29

General category "Pi" in the Unicode specification.

Java

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

        System.out.println(Character.INITIAL_QUOTE_PUNCTUATION);
    }
}

Output:

29


6. Character.LETTER_NUMBER

Syntax:

byte java.lang.Character.LETTER_NUMBER: 10

General category "Nl" in the Unicode specification.

Java

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

        System.out.println(Character.LETTER_NUMBER);

    }
}

Output:

10


7. Character.TITLECASE_LETTER

Syntax:

byte java.lang.Character.TITLECASE_LETTER: 3

General category "Lt" in the Unicode specification.

Approach

Java

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

        System.out.println(Character.TITLECASE_LETTER);

    }
}

Output:

3


8. Character.UNASSIGNED

Syntax:

byte java.lang.Character.UNASSIGNED: 0

General category "Cn" in the Unicode specification.

Approach

Java

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

        System.out.println(Character.UNASSIGNED);

    }
}

Output:

0


9. Character.UPPERCASE_LETTER

Syntax:

byte java.lang.Character.UPPERCASE_LETTER: 1

General category "Lu" in the Unicode specification. 

Approach

Java

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

        System.out.println(Character.UPPERCASE_LETTER);

    }
}

Output:

1


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- VII


No comments:

Post a Comment