A race condition in Java occurs when multiple threads access a shared resource simultaneously, resulting in unpredictable behavior and potentially incorrect results.