Character constants in Java Part - II

Some of the constants of the Character class in Java.

1. Character.MAX_VALUE

Syntax:

char java.lang.Character.MAX_VALUE : '￿' [\uffff]

The constant value of this field is the largest value of type char, '\u005CuFFFF'.

Approach:

Java

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

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

Output:

￿


2. Character.MIN_CODE_POINT

Syntax:

int java.lang.Character.MIN_CODE_POINT : 0

The minimum value of a Unicode code point, constant U+0000.

Approach:

Java

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

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

Output:

0


3. Character.MIN_SUPPLEMENTARY_CODE_POINT

Syntax:

int java.lang.Character.MIN_SUPPLEMENTARY_CODE_POINT : 65536

The minimum value of a Unicode supplementary code point, constant U+10000.

Approach:

Java

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

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

Output:

65536


4. Character.MIN_SURROGATE

Syntax:

har java.lang.Character.MIN_SURROGATE : '�'

The minimum value of a Unicode surrogate code unit in theUTF-16 encoding, constant '\u005CuD800'.

Approach:

Java

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

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

Output:

?


5. Character.MIN_VALUE

Syntax:

char java.lang.Character.MIN_VALUE : '' [\u0000]

The constant value of this field is the smallest value of type char, '\u005Cu0000'.

Approach:

Java

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

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

Output:

''


6. Character.SIZE

Syntax:

int java.lang.Character.SIZE: 16

The number of bits used to represent a char value in unsigned binary form, constant 16.

Approach:

Java

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

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

Output:

16


7. Character.MATH_SYMBOL

Syntax:

byte java.lang.Character.MATH_SYMBOL: 25

General category "Sm" in the Unicode specification.

Approach

Java

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

        System.out.println(Character.MATH_SYMBOL);

    }
}

Output:

25


8. Character.MODIFIER_LETTER

Syntax:

byte java.lang.Character.MODIFIER_LETTER: 4

General category "Lm" in the Unicode specification.

Approach

Java

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

Output:

4



Some more constants of Character class:


Character constants Part -I


Character constants Part -III


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