What is the `final` keyword's role in the Java Memory Model?
`final` is used to ensure that variables are never read by multiple threads simultaneously, thus preventing race conditions.
Thatâ€™s incorrect. While `final` guarantees immutability, it doesnâ€™t directly prevent race conditions by itself. Race conditions are prevented by proper synchronization.
Can you describe how race conditions occur and how to prevent them in a multithreaded Java application?