following are examples of using recursion methods in java programming:
public class Main { public static void printhello(int count) { if(count>0) { System.out.println("hello"); count--; printhello(count); } } public static void main(String[] args) { printhello(10); } }
total contributions (1)