repeat string in java

Solutions on MaxInterview for repeat string in java by the best coders in the world

showing results for - "repeat string in java"
Sofia
12 Mar 2016
1public class Main 
2{
3    public static void main(String[] args) 
4    {
5        String str = "Abc";
6 
7        String repeated = new String(new char[3]).replace("\0", str);
8 
9        System.out.println(repeated);
10    }
11}
12