Hi,

I have a quick question - on one of the exercises of the array lab it asks;


   - Just before the for loop that prints out the value of each entry of the
   ages[] array, create another for loop in which a value of 100 is assigned
   to the first entry of the array, ages[0], 101 to the next entry of the
   array, ages[1], and so on.


the way i achieved this was;

for(int j = 0; j < ages.length; j++){
            ages[j] = j+100;
            System.out.println(ages[j]);
        }


but im pretty sure thats not the way to do it.

can anyone tell me the correct way?

thanks

James

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to