Question: Building Objects from a File import java.io . * ; public class MiniFB { public static Listimport java.io . * ; public class MiniFB {
Building Objects from a File import
java.io;
public class MiniFB
public static Listimport
java.io;
public class MiniFB
public static List
Now that we're at least somewhat comfortable with reading from files in Java, we can do something a bit more usual read information in from a file and create objects from it
The task here is to complete method readInData that should open a file corresponding to the file name given as a String parameter, and construct a Listforming a simple database.
The data will be newline separated, with the following format:
Where the will determine which subclass of Person to create, is the person's name, and is a series of lines of additional of information corresponding to the type of person. A student will have in this order: the name of their degree, which year they're in An academic will have what subject they teach. A programmer will have their favourite programming language. This should be familiar!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
