string to char array, showing silly characters

后端 未结 4 1390
Happy的楠姐
Happy的楠姐 2021-01-24 12:51

It is a really simple question but I need an another eye to look at my code:

String strtr = \"iNo:\";
char[] queryNo = strtr.toCharArray();
System.out.println(qu         


        
4条回答
  •  被撕碎了的回忆
    2021-01-24 13:05

    You are trying to print the array and that is the reason you get gibberish. Try using Arrays.toString(queryNo) and you will see what you expected.

提交回复
热议问题