英文:
I want to print tab space in java. println("\t") doesn't work
问题
我正在上一门Java课程,我的老师做了这个操作
System.out.println("A\tB\tC\tD\tE\tF");
来显示 A B C D E F
但正如您在我的截图中看到的,它不起作用..!!!
我该如何解决这个问题。请帮帮我
英文:
I'm taking a java class rn and my teacher did this
System.out.println("A\tB\tC\tD\tE\tF");
to see A B C D E F
but as you can see in my screenshot, it doesn't work..!!!
how can I solve this. pls help me
答案1
得分: 4
你可以在Java中轻松地使用制表符空格。"\t" 是Java编程中的空格序列。下面我给出了一些例子:
示例1:
System.out.print("Happy\tBirthday");
输出:
Happy Birthday
示例2:
System.out.print("java\tprogramming");
输出:
Java programming。
英文:
you can give tab space in java easily. "\t" is the space sequence in java programming. Below i have given some examples:
Example 1:
System.out.print("Happy\tBirthday");
The output:
Happy Birthday
Example 2:
System.out.print("java\tprogramming");
The output:
Java programming.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论