We're going in circles now, but the question remains: what about those requirements are you stuck on?
Type: Posts; User: KevinWorkman
We're going in circles now, but the question remains: what about those requirements are you stuck on?
You've described what you want the code to do, and you've posted some code, but which part of your goals are you confused about? Which specific part are you stuck on? Where specifically in the code...
I'm not totally sure what your question is. What does the code you posted do? What does it do wrong?
Ah sorry, I wrote "Student" when I meant "Subject". My example should look like this:
List<Subject> subjects= new ArrayList<Subject>();
for(Subjects : subjects){
s.someMethod();
}
The for-each loop acts on a collection. So to use a for-each loop that iterates over instances of Student, you need a collection of Students.
List<Student> students = new ArrayList<Student>();...