Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Recursion in java

public class RecursionExample2 {  
static int count=0;  
static void p(){  
count++;  
if(count<=5){  
System.out.println("hello "+count);  
p();  
}  
}  
public static void main(String[] args) {  
p();  
}  
}  
Source by introcs.cs.princeton.edu #
 
PREVIOUS NEXT
Tagged: #Recursion #java
ADD COMMENT
Topic
Name
5+8 =