Create a text file that contains ten person objects where each object is represented on a separated line with each attribute separated by a comma. Create a method that reads form the file, creates one person object per line, and stores the object in an Array List object. Write the stored objects out by last name of the console. Solution //Program package person; import java.io.FileNotFoundException; import java.io.FileReader; import java.util.ArrayList; import java.util.Scanner; //person class class Person { String lastname; String firstname; int age; public Person(String last, String first, int a) { firstname=first; lastname=last; age=a; } @Override public String toString() { return (lastname+\" \"+firstname+\" \"+age); } } public class PersonDemo { public static void main(String[] args) throws FileNotFoundException { //creating array list ArrayList <Person> persons=new ArrayList<>(); //reading person data file Scanner infile=new Scanner(new FileReader(\"person.txt\")); while(infile.hasNextLine()) { String words[]=infile.nextLine().split(\",\"); persons.add(new Person(words[0],words[1],Integer.parseInt(words[2]))); } //display person s details System.out.println(\"Person details: \"); for(int i=0;i<persons.size();i++) { System.out.println(persons.get(i).toString()); } } } /////////////////////////////////////////////////////////////////// //person.txt input file Joseph,Daniel,23 Jhon,Stephen,34 Joseph,Maria,25 Fernandez,George,67 Jaitely,Arun,29 Kumar,Narendra,50 Victor,Prince,40 George,Jincy,35 Roldan,Tinu,28 Antony,Tim,27 .