 <p>Based on this comment:</p> <blockquote> <p>I didn't think it was relevant to the question. I am of course creating bodies once I start the program, by pressing 'm'. What I want is for deltaTime to update as I press 'm' more times i.e creating more bodies</p> </blockquote> <p>It seems like my guess is correct, that you're assuming that deltaTime will automatically increment whenever a new Body is created, and that is not how Java works. In order for that to happen you need to explicitly update deltaTime. One way is to use an observer design pattern, perhaps using PropertyChangeSupport to update deltaTime whenever a new Body is created.</p> <p>Although having said that, I've never used a PropertyChangeListener to listen to a static property before. </p> <p>But for example:</p> <pre><code>import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.util.Scanner; public class TestBody { private static final String QUIT = "quit"; public static int deltaTime = 0; public static void main(String[] args) { Body.addPropertyChangeListener(Body.NUM_OF_BODIES, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { deltaTime = 500*Body.getNum(); System.out.println("deltaTime: " + deltaTime); } }); Scanner scan = new Scanner(System.in); String line = ""; while (!line.contains(QUIT)) { System.out.print("Please press enter to create a new body, or type \"quit\" to quit: "); line = scan.nextLine(); Body body = new Body(); } } } class Body { public static final String NUM_OF_BODIES = "num of bodies"; private static PropertyChangeSupport pcSupport = new PropertyChangeSupport( Body.class); private static volatile int numOfBodies; public Body() { int oldValue = numOfBodies; numOfBodies++; int newValue = numOfBodies; pcSupport.firePropertyChange(NUM_OF_BODIES, oldValue, newValue); } public static int getNum() { return numOfBodies; } public static void addPropertyChangeListener(PropertyChangeListener l) { pcSupport.addPropertyChangeListener(l); } public static void removePropertyChangeListener(PropertyChangeListener l) { pcSupport.removePropertyChangeListener(l); } public static void addPropertyChangeListener(String propertyName, PropertyChangeListener l) { pcSupport.addPropertyChangeListener(propertyName, l); } public static void removePropertyChangeListener(String propertyName, PropertyChangeListener l) { pcSupport.removePropertyChangeListener(propertyName, l); } } </code></pre>