title: A question about enums defined inside a class in java
body: <p>This code is taken from a SCJP practice test:</p>
  
  <pre><code> 3. public class Bridge { 
   4.   public enum Suits { 
   5.     CLUBS(20), DIAMONDS(20), HEARTS(30), SPADES(30), 
   6.     NOTRUMP(40) { public int getValue(int bid) { 
                          return ((bid-1)*30)+40; } }; 
   7.     Suits(int points) {  this.points = points;  } 
   8.     private int points; 
   9.     public int getValue(int bid) { return points * bid; } 
  10.   } 
  11.   public static void main(String[] args) { 
  12.     System.out.println(Suits.NOTRUMP.getBidValue(3)); 
  13.     System.out.println(Suits.SPADES + " " + Suits.SPADES.points); 
  14.     System.out.println(Suits.values()); 
  15.   } 
  16. } 
  </code></pre>
  
  <p>On line 8 <code>points</code> is declared as private, and on line 13 it's being accessed, so from what I can see my answer would be that compilation fails. But the answer in the book says otherwise. Am I missing something here or is it a typo in the book?</p>