Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to display same statement multiple times in java

public void recursiveMe(int n) {
    if(n <= 5) {// 5 is the max limit
        System.out.print("_");//print n
        recursiveMe(n+1);//call recursiveMe with n=n+1
    }
}
recursiveMe(1); // call the function with 1.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #statement #multiple #times #java
ADD COMMENT
Topic
Name
8+3 =