What’s the output of following code? (单选)
class MyCode {
public static void main (String[] args) {
System.out.println(calc(30) % 3);
}
private static ArrayList<Long> arr = new ArrayList<Long>();
static {
arr.add(1L);
arr.add(1L);
}
private static Long calc(int x) {
if (arr.size() > x) {
return arr.get(x);
}
Long result = calc(x - 1) + calc(x - 2);
arr.add(result);
return result;
}
}