public class VariableTest {
public static void main(String[] args) {
System.out.println("* *");
System.out.println('*' + "\t" + '*');
System.out.println('*' + '\t' + '*');
System.out.println('*' + '\t' + "*");
System.out.println('*' + ('\t' + '*'));
}
}
输出结果为
题中的 ’ ’ 对应的是char、" " 对应的是String
’ ’ 是字符类型," "是字符串类型,
字符与字符用 + ,表示ASCII加在一起,是int整型
字符与字符串用 + ,表示连接在一起,是字符串