How to print the extended ASCII code in java from integer value

后端 未结 4 2046
遇见更好的自我
遇见更好的自我 2021-02-19 13:53
public static void main(String[] args) 
{
int i=153;
int j=63;
System.out.println((char)i);
System.out.println((char)j);
}


OUTPUT:-
?
?

I have some i

4条回答
  •  一个人的身影
    2021-02-19 14:17

    If this is a terminal encoding issue, I believe that this answer https://stackoverflow.com/a/362006/4828060

    is a fast and straightforward way to bypass the problem. Just add -Dfile.encoding=some_encoding to the parameters of the java command,

    e.g. java -Dfile.encoding=UTF-8 … MainClass

提交回复
热议问题