Access modifiers for inner classes
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/595179/protected-public-inner-classes">protected/public Inner Classes</a>  </p>
</blockquote>



<p>I am sure the question has been asked already, but I wasn't able to find one so I'll ask...</p>

<p>I am curious what is the difference between private(protected) and public inner class. I am able to use both from out of the containing class using the outer class object.</p>

<pre><code>public class A{
   private class B{

   }

   public static void main(String[] args){
     A a = new A();
     B b = a.new B();
   }
}
</code></pre>
