简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM