int temp = 0;
int n = 4;
temp = (n < 2 ? 1 : n * factorial(n-1)); // I don't understand this at all
System.out.println(temp);
This is what I think:
Java checks if 4 < 2, and since it's not, it initiates the second expression in the ternary operator, and 'n' is multiplied by 'n-1'. So you get 4 x 3, and that value is assigned to 'temp'. So now, 'temp' holds 12. After that, Java checks if 'n' is less than 2, and since 3 is less than 2, 'temp' gets multiplied by 2, so you get 12 times 2 which is 24.
Thanks,
Noidlox