串字符数组,表现出人物傻 [英] string to char array, showing silly characters
本文介绍了串字符数组,表现出人物傻的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是一个非常简单的问题,但我需要一个另一只眼睛看我的code:
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(queryNo + " =this is no");
和的输出是:
[C@177b4d3 =this is no
这些是什么字,你有什么想法的?
推荐答案
这是如何的toString()
实现数组。
的 [C
表示这是一个字符数组, 177b4d3
是哈希code。
The [C
denotes that is a char array, 177b4d3
is its hashcode.
您可能想看看
System.out.println(Arrays.toString(queryNo) + " =this is no");
如果你不想再见到你原来的字符串,你需要这样的:
if you want to see your original String again, you need this:
System.out.println((new String(queryNo)) + " =this is no");
这篇关于串字符数组,表现出人物傻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文