0
How do you write tab in Java?
tried using \t but doesn't work
3 Antworten
+ 5
You can add padding like this 👇
https://code.sololearn.com/cJ8Gaq6BazgP/?ref=app
+ 4
You're welcome!
This is how formatting works..
% is the format specifier. And %s means the format specifier for Strings.
When an integer is placed between the % sign and the format conversion (e.g. %10s) then the code acts as a minimum-width specifier.
This pads the output with spaces to ensure that it reaches a certain minimum length.
https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html
+ 2
it works perfectly, thank you so much