title: Get value of static property without knowing the class name
body: <p>Suppose I have an abstract class <code>Game</code>:</p>
  
  <pre><code>public abstract class Game
  {
      public static final int FRAME_LENGTH = 40;
  
      public static int getFrameLength() {
          return Game.FRAME_LENGTH; //What do I have to replace Game with?
      }
  }
  </code></pre>
  
  <p>And there is the class <code>App</code> which extends <code>Game</code>:</p>
  
  <pre><code>public class App extends Game
  {
      private static final int FRAME_LENGTH = 50;
  }
  </code></pre>
  
  <p>Now, when the method <code>App.main()</code> is executed, it prints <code>40</code>, I would have expected <code>50</code>, as <code>App</code> has overwritten the value of <code>FRAME_LENGTH</code>. I guess I would have to use something like <code>self</code> in the <code>Game</code> class, except java has no <code>self</code>.</p>
  
  <p>How am I supposed to access the static property <code>App.FRAME_LENGTH</code> without knowing beforehand that the child class will be called <code>App</code>?</p>
  
  <h2>Edit</h2>
  
  <p>Okay, based on the first answer, I think I have to specify my question a little.</p>
  
  <p>First, I change the scope of <code>FRAME_LENGTH</code> to <code>public</code>. For the sake of this question, this makes things easier. Second, I changed the method <code>getFrameLength</code> which was previously called <code>main</code>.</p>
  
  <p>The problem I am facing: Right now, I do not know which classes will extend <code>Game</code>, and <code>Game</code> should not need to know, either.</p>
  
  <p>If you look at the code, you will be able to see that <code>Game.FRAME_LENGTH</code> is <code>40</code> and <code>App.FRAME_LENGTH</code> is <code>50</code>. <code>Game.getFrameLength()</code> returns <code>40</code> as expected, but <code>App.getFrameLength()</code> returns <code>50</code>, I would expect (or rather want) it to return <code>50</code>.</p>
  
  <p>My question now is very simple: In the above code, what do I have to change <code>return Game.FRAME_LENGTH;</code> to, so it returns the correct value (meaning the value of <code>FRAME_LENGTH</code> of the class the method is called on), similar to <code>self::$frameLength</code> in PHP.</p>