I'm having trouble with putting scanned information into array in Java.
private void initializeFriends()
{
//initialize the size of array:
friends = new Friend[200];
//initialize the first 5 objects(Friends):
friends[0] = new Friend("Rodney Jessep", "rj2013", "Brisbane", "hi!");
friends[1] = new Friend("Jaime Smiths", "abcd5432", "Sydney", "how's going");
friends[2] = new Friend("William Arnold", "william1994", "Brisbane", "boom");
friends[3] = new Friend("James Keating", "qwerty52", "Newcastle", "Hey");
friends[4] = new Friend("Amy Richington", "IAmRichAmy", "Perth", "Yo");
}
After the procedure above is run, a method called addFriends() is run where a scanner comes in to put data into friend structure.
What is the best way to scan in information into an array? Would using the Scanner in = new Scanner(System.in); feature be wise since there are so many different elements in 'Friend': (String name, String username, String city, String message)?