Java setter and instane -- Change a variable : I'm trying to learn how to change an instance once it's already created.  I have a constructor with a loop that prints my setting variable.  Variable setting starts as 0 being unset, and the loop loops until the setting variable isn't 0.  My obviously wrong expectations were that:

 1. A new instance would be created named object.
 2. The loop would run because the setting variable is 0.
 3. The setting variable would be changed to 1.
 4. The loop would stop.

I Ask:

 1. Why isn't my while loop using the updated variable "setting"?
 2. Is this the correct way to something that already instantiated?
 3. If there's a better way please leave an example so I can learn.  

        public class test2 extends Thread
        {
        private int setting;   
  
    
        public void setSetting(int input) 
        {
           this.setting = input;
        }
       
    
        public test2() 
        {        
             while (setting == 0) {
             System.out.println(setting); }
        
        }
 
        
        public static void main(String[] args) 
        {
            test2 object = new test2();
            object.setSetting(1);
        
        }
        
        }
