+ 1
how to input a string and output it several times in java..
how to input a string and output it several times in java..
6 odpowiedzi
+ 14
● U can make use of loop OR recursion 👍
//here is basic Recursion function possible for it :
static void method(n,str){
if(n--==0) System.exit(0);
System.out.println(str);
}
+ 3
Prompt the user to input a string and put the print statement inside loop
+ 3
Ya ..use the Scanner class
Scanner input = new Scanner(System.in);
String str = input.next()
+ 2
In addition to Fabian code and if you need full control over input text and number of iteration
https://code.sololearn.com/c1cJk2vFH6ZV/?ref=app
+ 1
Can we promt in java..