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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -