Given the class Arithmetic with a recursive method my_method().
public class Arithmetic{
public int my_method( n ){
if(n==1){
return 4;
} else{
return 2 + 3 * my_method(n-1)
}
public static void main(String[] args){
Arithmetic ari = new Arithmetic();
System.out.println( ari.my_method(4) );
Question:
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here