Generally JVM copies frequently accessed variable in to the register memory for speedy access.Volatile emphasis that always the variables are read from the main memory to avoid
duplicate copies.
duplicate copies.
package com.mkyong.java8; import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; im...