a.
public static void main(String[] args) {
xmethod(5);
}
public static void xmethod(int n) {
if(n > 0) {
System.out.print( n + " ");
xmethod (n-1);
}
}
}
//output:
5 4 3 2 1
b.
public static void main(String[] args) {
xmethod(5);
}
public static void xmethod(int n) {
if(n > 0) {
xmethod (n-1);
System.out.print( n + " ");
}
}
}
//Output:
5 4 3 2 1