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