Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java repeat method

class GFG {
    public static void main (String[] args) {
      String string = "abc";
      int count = 3;
      System.out.println("String :" + string.repeat(count));
    }
}
Comment

how to repeat string in java

public class Main 
{
  public static void main(String[] args) 
  {
    String str = "Abc";
 
    String repeated = new String(new char[3]).replace("", str);
 
    System.out.println(repeated);
  }
}
Comment

Repeat a string in java

string.repeat(count);
Comment

how to repeat string in java

FOR JAVA 8 :

import static java.util.stream.Collectors.joining;
import static java.util.stream.Stream.generate;

String repeat(int count) {
 
    return Stream.generate(() -> "ABC").limit(count).collect(Collectors.joining());
}
Comment

PREVIOUS NEXT
Code Example
Java :: java import keyword 
Java :: java and python begineers mcq with answers 
Java :: java listfiles filter 
Java :: and two editText fields in android studio 
Java :: android pick up photo from local device 
Java :: java modulus opperation 
Java :: how to create a sublist in java 
Java :: convert kotlin code to java 
Java :: key caracter from code java 
Java :: java applet draw house 
Java :: Which of the below is a correct identifier for a method name in Java * 2 points 0start #stop 0_start *start# 
Java :: Uri.builder in android studio 
Java :: Exercise. Create a simple Java program using array named SumOfArray.java that will accept an input of whole numbers or floating point numbers and will return the Sum result. The program must accept at least 5 numbers. 
Java :: preparestatement method in java 
Java :: Java TestNG Data Provider 
Java :: random numeros negativos java 
Java :: java thyemleaf save table form to database 
Java :: data structure in java 
Java :: retrofit with api key post 
Java :: Kotlin const to Java 
Java :: charstreams cannot be resolved 
Java :: localdatetimw java input 
Java :: convert python to java translator online 
Java :: java static nested class 
Java :: java lambda expressions qunado foi implantada 
Java :: why fields should be final in immutable class? 
Java :: overwrite confguration value spring 
Java :: javafx choicebox get index 
Java :: java jbutton hover 
Java :: java Sum of all the factors of a number 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =