I am receiving an error that states that I need to specify a main class. As I am new to Java and IntelliJ I do not know what to specify. Here is an example that I am working on:
public class Grades
{
public static void main(String[] args)
{
int grade1 = 95; //first grade
int grade2 = 88; //second grade
int grade3 = 76; //third grade
//calculate average
int avgGrade = (grade1 + grade2 + grade3)/3;
//print results
System.out.print("Average = ");
System.out.println(avgGrade);
}//end of main method
}//end of class
I would appreciate any suggestions!
A
main
class is one that contains an entry-point (in Java, that's yourmain
method). So yourmain
class isGrades
.