Biology Forums - Study Force

Science-Related Homework Help Computer Studies Topic started by: parneetgill on May 5, 2020



Title: What are the base cases in the following recursive method? public static void xMethod(int n) {if (n ...
Post by: parneetgill on May 5, 2020
What are the base cases in the following recursive method?

public static void xMethod(int n) {
if (n > 0) {
System.out.print(n % 10);
xMethod(n / 10);
}
}


▸ n <= 0

▸ n < 0

▸ n > 0

▸ no base cases


Title: What are the base cases in the following recursive method? public static void xMethod(int n) {if (n ...
Post by: joanamet on May 5, 2020
Content hidden