1 class Pattern{ 2 3 void printPattern(int number){ 4 //The trival case 5 if (number == 1){ 6 System.out.print(number); 7 return; 8 } 9 10 printPattern(number-1); 11 System.out.print(number); 12 printPattern(number-1); 13 } 14 15 public static void main(String args[]){ 16 int number = Integer.parseInt(args[0]); 17 Pattern pattern = new Pattern(); 18 pattern.printPattern(number); 19 } 20 }