Write a recursive method:
public static int raise2ToN(int n)
//computes and returns the value of 2n using
//recursion.
Note: 2^3 = 2 * 2^2 .
2^2 = 2 * 2^1
2^1 = 2
What value/values of n will stop the recursion (base case)?
Sample output:
5
2 to 5 is 32
Expert Answer
Answer to Write a recursive method: public static int raise2ToN(int n) //computes and returns the value of 2n using //recursion. N…