16 If the method below was called with the value 4 (for example print(4)), how many times would “Hello World" be printed
Posted: Fri May 20, 2022 1:44 pm
16 If the method below was called with the value 4 (for example print(4)), how many times would “Hello World" be printed out? 14 public static void print(int num) { 15 if(num == 1){ //simply "give" control back A.) 4 17 return; B.) 3 18 }else{ C.) 2 System.out.println("Hello World"); D.) 0 20 print(num-1); 21 } 22 } 19 Hint : Step through the program one line at time, keep track of the value stored in num.