public class HelloWorld{
public static void main(String[] args) {
final char MSEX='男';
final char FSEX='女';
System.out.println(MSEX + FSEX);
}
}为什么我这样写输出结果是:52906
System.out.println(MSEX + FSEX);
此行的“+”为函数重载,char类型+char类型返回值为int型。
此行可以改为System.out.println(MSEX+" "+FSEX);
字符不能相加!!!MSEX + FSEX错了