Author | Message |
---|---|
ckolodin
Posts: 6
|
Posted 01:54 Apr 10, 2009 |
A: This method only works for positive i. If i is odd (and negative) i%2 is -1. To fix it just include the case where i%2 is -1 in the return statement. public static boolean odd (int i) {return (i % 2 == 1 | i % 2 == -1); } |
mhajianpour
Posts: 20
|
Posted 09:52 Apr 10, 2009 |
Good job. That's the problem with the method. Let me know if you want more. ;) -- |