well...my problem is im storing values from a file into a regular object called Students. I then take that information and assign it to an array of Student objects.


try
{
fileReaderIn = new FileReader("A2Q1in.txt");
fileIn = new BufferedReader(fileReaderIn);

testLine = fileIn.readLine();
while(testLine != null)
{
String[] result = testLine.split("\\s+");

//im previously aware of what the input file looks like
students1.setALL(result[1], result[0], result[2]);
students1.setGPA(Double.parseDouble(result[3]));


students4[counter] = students1;//if i test this, i find that the values are being store into the array
//-----------------------------------------------------
System.out.println("Counter----> " + counter);
counter++;
testLine = fileIn.readLine();
}
fileIn.close();
}
catch (IOException ioe)
{
System.out.println(ioe.getMessage());
ioe.printStackTrace();
}
//-----------------------------------------------------

System.out.println("counter ---> " + counter);
students = new Student[counter];
for(int j = 0; j < counter; j++)
{
students[j] = students4[j];// printing this will print the same person from each entry
}

return students;

now somewhere between the dashed lines, all of my values in my array of objects become one and the same, and whether by coincience or logic problems they all are the last bit of info retrived from the file.

im not sure what it is im doing wrong but if anyone could help me with arrays of objects that would be much appreciated. Thx