Character constants in Java Part -III

Some of the constants of the Character class in Java.

1. Character.COMBINING_SPACING_MARK

Syntax:

byte java.lang.Character.COMBINING_SPACING_MARK: 8

General category "Mc" in the Unicode specification.

Approach

Java

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

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

Output:

8


2. Character.CONNECTOR_PUNCTUATION

Syntax:

byte java.lang.Character.CONNECTOR_PUNCTUATION: 23

General category "Pc" in the Unicode specification. 

Approach

Java

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

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

Output:

23


3. Character.CONTROL

Syntax:

byte java.lang.Character.CONTROL: 15

General category "Cc" in the Unicode specification. 

Approach

Java

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

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

Output:

15


4. Character.CURRENCY_SYMBOL

Syntax:

byte java.lang.Character.CURRENCY_SYMBOL: 26

General category "Sc" in the Unicode specification. 

Approach

Java

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

        System.out.println(Character.CURRENCY_SYMBOL);

    }
}

Output:

26


5. Character.DASH_PUNCTUATION

Syntax:

byte java.lang.Character.DASH_PUNCTUATION: 20

General category "Pd" in the Unicode specification. 

Approach

Java

public class CharacterConstants1 {
    public static void main(String[] args) {
    
        System.out.println(Character.DASH_PUNCTUATION);
    
    }
}

Output:

20


6. Character.DECIMAL_DIGIT_NUMBER

Syntax:

byte java.lang.Character.DECIMAL_DIGIT_NUMBER: 9

General category "Nd" in the Unicode specification.

Approach

Java

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

        System.out.println(Character.DECIMAL_DIGIT_NUMBER);

    }
}

Output:

9


7. Character.MODIFIER_SYMBOL

Syntax:

byte java.lang.Character.MODIFIER_SYMBOL : 27

General category "Sk" in the Unicode specification.

Approach

Java

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

    }
}

Output:

27


8. Character.NON_SPACING_MARK

Syntax:

byte java.lang.Character.NON_SPACING_MARK: 6

General category "Mn" in the Unicode specification.

Approach

Java

public class CharacterConstants7 {
    public static void main(String[] args) {
        System.out.println(Character.NON_SPACING_MARK);
        
    }
}

Output:

6



Some more constants of Character class:


Character constants Part -I


Character constants Part -II


Character constants Part - IV


Character constants Part -V


Character constants Part -VI


Character constants Part- VII


Character constants Part -VIII

No comments:

Post a Comment