Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.09 seconds.

  1. Replies
    11
    Views
    1,113

    Re: Nested For...each Loop?

    We're going in circles now, but the question remains: what about those requirements are you stuck on?
  2. Replies
    11
    Views
    1,113

    Re: Nested For...each Loop?

    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...
  3. Replies
    11
    Views
    1,113

    Re: Nested For...each Loop?

    I'm not totally sure what your question is. What does the code you posted do? What does it do wrong?
  4. Replies
    11
    Views
    1,113

    Re: Nested For...each Loop?

    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();
    }
  5. Replies
    11
    Views
    1,113

    Re: Nested For...each Loop?

    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>();...
Results 1 to 5 of 5