title: Get static variable from class stored in Class variable
body: <p>Is there any way this can be done:</p>
  
  <pre><code>Class cls = MyClass.class;
  int variable = cls.staticVariable;
  
  Class MyClass {
      public static int staticVariable = 5;
  }
  </code></pre>
  
  <p>Class cls will always contain a class that has the variable staticVariable, but it won't always be the same class. Hope you understand.</p>