What does \t do in Java?

\t is a tab character.

You can use this special character to insert a tab inside Java strings.

For example this:

System.out.println("a bit of text\tthen some more\tand the last piece");

Will print:

a bit of text	then some more	and the last piece