I have a variable:
String title = "titleHere";
How would I print the name out three times instead of writing
System.out.println(title);
System.out.println(title);
System.out.println(title);
or using a for
loop?
For example, Ruby lets you write title * 3
and Perl lets you write title x 3
, so does Java have this too?