I am almost completely new to Java and programming in general (my main degree is in Law, but I hope to open myself up to programming, as I really believe that this will be an important skill for a couple of years).
I created two classes, LabClass and Student , and I need to point students to the classroom, providing them loans for registration.
Here is the method in my Student class that I am trying to access:
public void addCredits(int additionalPoints) { credits += additionalPoints; }
And here is the method in my LabClass class that I am trying to use:
public void enrollStudent(Student newStudent) { if(students.size() == capacity) { System.out.println("The class is full, you cannot enrol."); } else { students.add(newStudent); } students.addCredits(50); }
I do not understand why BlueJ says that it cannot find the "addCredits" method. I am a real beginner, so I'm sorry if this is a stupid question, but any help would be greatly appreciated!
Brian source share