title: Why can't java main class be protected?
body: <p>I can create Main class with Access specifier "public" or default.</p>
  
  <p>But why can't I create with protected. As default itself allowed why not protected.</p>
  
  <p>Public:</p>
  
  <pre><code>public class MainClass {
   public static void main(String[] args) {
   }
  }
  </code></pre>
  
  <p>Default:</p>
  
  <pre><code>class MainClass {
   public static void main(String[] args) {
   }
  }
  </code></pre>
  
  <p>Protected:</p>
  
  <pre><code>protected class MainClass {
   public static void main(String[] args) {
   }
  }
  </code></pre>
  
  <p>Its showing error: 
  Illegal modifier for the class MainClass; only public, abstract &amp; final are permitted MainClass.java SCJP/src line 1 Java Problem</p>