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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -