所以我只是想知道是否有一种方法可以在一行中打印出多个 char
变量,而不会像传统打印语句那样将 Unicode 添加在一起。
例如:
char a ='A';
char b ='B';
char c ='C';
System.out.println(a+b+c); <--- This spits out an integer of the sum of the characters
最佳答案
System.out.println(a+""+b+""+c);
或:
System.out.printf("%c%c%c\n", a, b, c);
关于java - 在一行中打印多个字符变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19169185/