java - Print Character Multiple times -
how can print character multiple times in single line? means cannot use loop.
i'm trying print " _" multiple times.
i tried method it's not working:
system.out.println (" _" , s); s variable.
you can print in same line system.out.print(" _"); can use loop. print instead of println not append new line character.
for (int i=0; i<5; i++){ system.out.print(" _"); } will print: _ _ _ _ _.
Comments
Post a Comment