View Single Post
  #10 (permalink)  
Old 01-03-2008, 01:19 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
Okay.

Lets say activeEntries is the number of entries in your list.

To display those entries, (and not the whole array as gibsonrocker800 explained) you must use a for loop:

Code:
public static void displayAll(){ for (int i = 0; i < activeEntries; i++){ System.out.println("First name: " + firstName[i]); System.out.println("Last name: " + lastName[i]); System.out.println("Telephone Number: " + telephoneNumber[i]); System.out.println("Enrolment Number: " + enrolmentNumber[i]); } }
Do you follow?
__________________
If your ship has not come in yet then build a lighthouse.
Reply With Quote