------<a target="blank">Java培训、Android培训、iOS培训、.Net培训</a>、期待与您交流! -------
//为什么char类型数组默认值是a? 而不是 "\u0000"
//是环境搭建问题?不明白,求大神指点!(电脑是WIN8.1 64位)
class Char_a
{
public static void main(String[] args)
{
char [] c=new char [5];
for (int x=0 ; x<=4 ; x++ )
{
System.out.println("c["+x+"]="+c[x]);
}
char [] c2= {'\u0000'};
System.out.println("c2[0]="+c2[0]);
System.out.println("c2[0]==c[0]"+(c2[0]==c[0]));
System.out.println("'a'==c[0]"+('a'==c[0]));
}
}
|
|