输出时候两个char变量中间用连接符+的问题 [已解决!谢谢各位 ]
public class HelloWorld{
public static void main(String[] args) {
final char sex1 = '男';
final char sex2 = '女';
System.out.println(sex1+sex2); //应该是这样System.out.println(sex1+""+sex2);
System.out.println(sex2); //多谢 @bigqiang0 给出的答案:(个人感觉这种更贴近标准)
} //System.out.println(String.valueOf(sex1)+String.valueOf(sex2));
}
//输出结果:
//52906
//女
//问题:怎么解决这个问题,不用String的情况下;
//谢谢!