Sending information from one method to another

Here's what I'm trying to do and I'll explain it as best as I can.

1. input a number that represents the total number of students (Done)
2. take that number, send it to the "enterGrade" method (NOT DONE)

In my code below the "enterGrade" portion i'm stuck at is represented by <<<<<<<<<<<<<<<<<<<<<<<

Any suggestions and help are appreciated.






public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            //enter student amount
            System.out.println("Enter number of students: ");
            int student = input.nextInt();
            //check if more than 25 students
            if (student > 25) {
                  System.out.println("Cannot have more than 25 students, try again.");
                  System.exit(0);
                  
                  
            }
                //Send number of students to enter grade method <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            int grade = enterGrade(int[] student);
      }
                  
      public static void enterGrade(int[] student) {
            Scanner input = new Scanner(System.in);
            System.out.println("Enter student's grades");
            int grades = 0;
            while( grades < student.length) {
                  student[grades] = input.nextInt();
                  grades++;
                  
                  
            }
            studentName();
      }
            
      public static void studentName() {
            
      }
Grant RichardsStudentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

awking00Information Technology SpecialistCommented:
The first problem is in your main method. Student is an int (i.e. a single number <= 25) and you're trying to pass it as an int array to be populated with grades. You need to create the int array object first (e.g. int[] students = new int[student]), then pass it to the enterGrade method. There is no need to enter the object type, just pass the object itself. You will however need to define the type being passed in to the  enterGrade method when you create it. Hope it helps get you started.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.