anyway the code:
public void setScore(int mod )
{
System.out.println("the number of credits recieved is: ");
mark = mod;
System.out.println( mark );
}
public void modifyCredit()
{
for(Student student : students) {
LabClass.setScore(mod);
student.c = student.c + mod;
}
}
gives me the error:
non static method score(int) cannot be referenced from a static context
what I'm trying to do is have one method (setScore)score for inputting a credit modifier (i.e. losing or gaining a certain number of credits) and another method (modifyCredit) calling that method for each student in the class
am I going about this the right way?
(I'm using blueJ if that's important)

New Topic/Question
Reply


MultiQuote



|