Used since threads can have their own copy of memory, and "volatile" ensures there's only one copy of the variable, so all threads will see the same value
Synchronized
modifies code blocks or methods
use locks to ensure only one thread at a time can run the code
includes variables, i.e. there is no need for volatile on synchronized variables. (which results in more overhead)
Volatile
volatile int demo = 5;
Synchronized