我需要在一种方法中将String参数传递给另一种方法?

所以我需要将AddNewStudent方法中的String数组参数传递给ADDNewSMark方法。但是编译器在我调用AddNewSMarks(SID)的地方给了我一个错误; AddNewStudent方法中的行。它向我显示错误,

method AddNewSMarks in class Example cannot be applied to given types; AddNewSMarks(); required: String[] found: no arguments reason: actual and formal argument lists differ in length 1 error

public static void AddNewSMarks(String [] SID){
Scanner input=new Scanner(System.in);

AddNewStudent();

double [] fundemental=new double[15];
double [] database= new double[15];


for (int i = 0; i < 15;i++)
{
System.out.print("Programming Fundemantal Marks : ");
double fMarks=input.nextDouble();
if(fMarks<0 && fMarks>100){
System.out.println("Invalid marks, please enter correct marks.");
break;
}else{
fundemental[i]=fMarks;
}
}
for (int j = 0; j< 15; j++)
{
System.out.print("Database Management System Marks : ");
double dMarks=input.nextDouble();

if(dMarks<0 && dMarks>100){
System.out.println("Invalid Marks, please enter coorect marks.");
break;
}else{
database[j]=dMarks;
}

}

}
评论