其实今天学的东西很多,不过可以记录的不多
1.
A return statementt is required for a nonvoid method. The method shown below is logically correct, but it has a complication error because the Java complier thinks it possible that this method does not return any value.
public static int sign(int n) {
if (n < 0) return 1;
else if (n == 0) return 0;
else if (n > 0) return -1;
}
To fix problem, just delete (n > 0)