Manish Kumar
Manish Kumar

Reputation: 67

Why this code always produce output as '?'

As we know java follows unicode system which supports all alphabets of many languages. I searched and found that Unicode value for अ is 2309 and value for आ is 2310 which are alphabets of DEVANAGRI language. The code i have written is something like this.

class Test
{
    public static void main(String args[])
    {
        char a=(char)2310;
        System.out.println(a);
    }
}

No matters I write 2309 or 2310 the output is '?' always. How this is happening?

Upvotes: 0

Views: 1413

Answers (1)

Pranalee
Pranalee

Reputation: 3409

you are trying to print characters that are not supported by character set of console. you can try changing console character set as mentioned here Can't print hindi characters

Upvotes: 13

Related Questions