 However, if the two writes are reordered, then the read of y can return the value 2, and the read of x can return the value 0.The Java Memory Model (JMM) defines the allowable behavior of multithreaded programs, and therefore describes when such reorderings are possible.It places execution-time constraints on the relationship between threads and main memory in order to achieve consistent and reliable Java applications.