I have been working on a toString method printing out the contents of an ArrayList. I was just wondering if someone could explain to me on how to break each individual Person, Age and DOB on a new line (\n) instead of having them print in one long array with brackets.
Here is the output for my code as well as the expected output.
expected Name: \n"Peter", Age: 16, DOB: Feb 15, 2000\n"Colin", Age: 15, DOB: March 12, 2001
actual Name: \n["Peter", Age: 16, DOB: Feb 15, 2000, "Colin", Age: 15, DOB: March 12, 2001]