title: Class is public, should be declared in a file named .java
body: <p>I'm having this problem which I'm not sure why it's caused.</p>
  
  <p><strong>"class Account is public, should be declared in a file named Account.java"</strong></p>
  
  <p>I have 5 classes in my program, all in the same file and all are public:</p>
  
  <ul>
  <li>Class called Main which includes the main method</li>
  <li>Class called Account is abstract</li>
  <li>3 classes Account1, Account2, Account3 which extend the abstract class</li>
  </ul>
  
  <p>I named my file Main.java, and it's giving me this error. Then I named my file Account.java, and I got the same error again.</p>
  
  <p>What should I do?</p>