java 8 repeat string n times code example Example: multiple string java String string = string.repeat(repeatTime);