Computer Science, asked by samtipton2, 1 year ago

What is returned as a result of calling mystery(1)?

public static int mystery (int x) {
if (x == 5){
return x;
} else {
return mystery(x--) * 5;
}
}



1-StackOverFlowError
2-25
3-nothing
4-5

Answers

Answered by katkeriya
0

Answer:

what is this? didn't understand !

Answered by DevilCrush
7

Answer:

Explanation:

public static List<Integer> process1(int n)

{

  List<Integer> someList = new ArrayList<Integer>();

  for (int k = 0; k < n; k++)

     someList.add(k);

  return someList;

}

public static List<Integer> process2(int n)

{

  List<Integer> someList = new ArrayList<Integer>();

  for (int k = 0; k < n; k++)

     someList.add(k, k);

  return someList;

}

Similar questions