Weird behaviour
No. 240
|
Q: |
We consider a method computing a given A larger piece of software using this method produces
erroneous results. Hunting for errors the developing team adds a
static public int getSquare (int value) {
final int result = value * value;
System.out.println("Square: " + result);
return result;
}The team is baffled when negative results show up: Square: -1757895751
|
||||||||
|
A: |
|
