I\'ve read that "volatile" in Java allows different threads to have access to the same field and see changes the other threads has made to that field. If that\'s the c
volatile doesn't "allow the sharing" of anything. It just prevents the variable from being cached thread local, so that changes to the variables value occur immediately. Your d variable is an instance variable and is thus owned by the instance that holds it. You'll want to re-read the threading tutorials to re-align your assumptions.
One decent reference is here