** When used in a string **
sample
System.out.println("delicious\t mandarin orange");
Console: Delicious oranges
** When using variables **
sample
String sample1 = "normal";
String sample2 = "Strawberry";
System.out.println(sample1 + "\t" + sample2);
Console: Normal strawberry
Windows
sample
System.out.println(sample1 + "\t" + sample2);
System.out.println(sample1 + "¥t" + sample2);
Both \ and \ can be used
mac
sample
System.out.println(sample1 + "\t" + sample2);
System.out.println(sample1 + "¥t" + sample2); //Backslash and backslash are distinguished on mac
console: Ordinary strawberry Ordinary ¥ t strawberry
** Escape sequence (partial) **
| Escape sequence | Meaning of symbols | Center align |
|---|---|---|
| ¥" | Double quotation | |
| ¥' | Single quote | |
| column | new line | |
| will | ¥(Circle)mark | will |
| be | be | be |
| left | right | center |
| aligned | aligned | aligned |
Recommended Posts