title: Java class error Main.java:3: error:
body: <p>I keep getting this error message I have checked my file names, and my public class is the same as my .java file. Besides checking that I have no idea where to go.</p>
  
  <pre><code>Main.java:3: error: class ClassGenderPercentages is public, should be    declared in a file named ClassGenderPercentages.java
  public class ClassGenderPercentages
     ^
  </code></pre>
  
  <p>Here is my code</p>
  
  <pre><code>import java.util.Scanner;
  
  public class ClassGenderPercentages
  
  {
  public static void main (String args[])
  {
  
      Scanner keyboard = new Scanner(System.in);
      int maleStudents, femaleStudents;
      int totalStudents;
      double maleStudentPercentage, femaleStudentPercentage;
  
      maleStudents = keyboard.nextInt();
      System.out.println("Enter number of male registered:" + maleStudents);
  
      femaleStudents = keyboard.nextInt();
      System.out.println("Enter number of female registered:" + femaleStudents);
  
  
      totalStudents = (int) (maleStudents + femaleStudents);
      maleStudentPercentage = ((100 * maleStudents) / totalStudents);
      femaleStudentPercentage = ((100 * femaleStudents) / totalStudents);
  
  
  
      System.out.println("The percentage of males registered is: " + maleStudentPercentage + "%");
      System.out.println("The percentage of females registed is: " + femaleStudentPercentage + "%");
   }
  }
  </code></pre>