title: How to access public constant variables of main class from a sub class?
body: <p>I have a main class with a couple of public constant variables, and I have a custom class, I would like to know how can I access the constants of the main class from the custom class?</p>
  
  <p>Main Class code:</p>
  
  <pre><code>import processing.core.*;
  import toxi.geom.*;
  import toxi.math.*;
  
  public class VoronoiTest extends PApplet {
  
      // this are the constants I want to access from the Site class
      public static int NUM_SITES         = 8;
      public static int SITE_MAX_VEL      = 2;
      public static int SITE_MARKER_SIZE  = 6;
  
      Site[] sites;
  
      public void setup() {
          size( 400, 400 );
  
          sites = new Site[NUM_SITES];
          for ( int i = 0; i &lt; sites.length; i++) {
              sites[i] = new Site( this );
          }
      }
  }
  </code></pre>
  
  <p>And this is the Site class code:</p>
  
  <pre><code>import processing.core.*;
  
  
  public class Site {
      PApplet parent;
  
      float x, y;
      PVector vel;
  
      int c;
  
      Site ( PApplet p ) {
              parent = p;
              // here I try to get the constants from the main class
              vel = new PVector( parent.random(-parent.SITE_MAX_VEL, SITE_MAX_VEL), parent.random(-SITE_MAX_VEL, SITE_MAX_VEL) );     
      }   
  }
  </code></pre>
  
  <p>Any help will be much appreciated!</p>