+ 12
What is meaning of "%2s" in Java
8 Antworten
+ 8
It is not just a Java thing by the way. It is a general format used by several languages!
+ 8
I was trying to tell it to Guitar God. I'm sure you know it Serena Yvonne.
+ 5
Thanks Serena Yvonne
+ 1
hi, the % character in the format part of printf tells it that the next characters tell how to format the corresponding variable to print. ..:printf("%12s" , str); saves space in the ouput line for 12 character string to print str. So if str is 8 chartacts long, the output will be padded with 4 spaces. if str is longer than 12 everthing to the right of str pushed over 12-len(str) characters
- 2
a java new artificial program in such as add,subtraction, multiple