title: Accessing a public final constant in another class?
body: <p>I'm trying to access a constant in java that's stored in "Constants.java", a private class, and use it in another to evaluate it in a method.</p>
  
  <p>I'm not allowed to change the Constants class, and the constant I'm trying to accessed is initialized in the following way:</p>
  
  <pre><code> public final int INVENTORY_MAX = 100;
  </code></pre>
  
  <p>I tried the following:</p>
  
  <pre><code> if (h &lt;= Constants.INVENTORY_MAX)
  </code></pre>
  
  <p>But Constants is private and without it, it's asking me to make a local variable. I also would make the variable static, but the code is given by the professor and I cannot change it in any way. Please help!</p>
  
  <p>Thank you.</p>
  
  <p>EDIT: The following is a screenshot that shows that the Constants class is private. Ignore the error message under Constants.</p>
  
  <p><a href="http://i.stack.imgur.com/bBVd3.png" rel="nofollow">Class Constructor</a></p>
  
  <p><a href="http://i.stack.imgur.com/Niwrs.png" rel="nofollow">Constants</a></p>