<p>I have a simple question. Is there a way ( using reflections I suppose ) to iterate all the static values of a class?</p>

<p>For instance </p>

<pre><code>class Any {
    static int one = 1;
    static int two = 2;
    static int three = 3;

    public static void main( String [] args ) {
          for( int i : magicMethod( Any.class ) ){
              System.out.println( i );
          }
    }
 }
</code></pre>

<p>Output</p>

<pre><code> 1
 2
 3
</code></pre>

<p>Thanks.</p>

Hey.. it was very easy.  :P
```
```
Field [] constants = Main.class.getFields();
      Object some = new Main();
      for( Field field : constants ){
          if(Modifier.isStatic(field.getModifiers() ) && 
             field.getType() == int.class  ) {
                    System.out.println( field.getInt( some  ) );
          }
      }
```
```