I have an array which has objects of people in a football team. It holds information such as their first name, second name and address. When i use the code shown below the text file contains values like this: member@29086037
The code is shown below:
try
{
    PrintWriter pr = new PrintWriter ("memberDetails.txt");
    for (int i = 0; i < collection.length; i++)
    {
    pr.println(collection[i]); 
    }
    pr.close();
} catch (FileNotFoundException ex)
{
    System.out.println(ex.getMessage());
    System.out.println("in" + System.getProperty("user.dir"));
    System.exit(1);
}
What am I doing wrong?
 
     
     
     
     
     
    