I think Java handles it OK for floats. I.e. Tests for positive infinity and negative infinity etc. I don't think Java handles it for integer maths.
Java integer math is mandated to have wrap-around semantics. So you can do something like
if ((b^c) > 0 && (a^c) < 0 && (a^b) < 0) overflow Paolo