Code
boolean isNegative = (x < 0);
this is an assignment that only occurs once. the value stored here will stay until you re-assign it, regardless of the current value of x. if you want it to behave in such a way isNegative always looks at the current value of x, then you can create a method so it's re-evaluated every time it's called.