Question: how do i make the method from what i already have? public class CSVREADER{ String path; Scanner in; File fileObj; int getFileSize(String s){ int size;
how do i make the method from what i already have?
public class CSVREADER{
String path;
Scanner in;
File fileObj;
int getFileSize(String s){
int size;
while(this.in.hasNextLine()){
this.in.nextline();
size++
}
return size
}
public csvReader(String path){
this.path = path;
this.fileObj = new File(path);
this.in = new Scanner(fileObj);
}
Flight[] getFlights(String f){
Flight flightList = new flight(f);
}
}
Method Name: getFlights Return Type: Flight[] Parameters: String Description: This method receives the name of the file that contains the flights' information. It makes and stores the Flight objects based on the information from the file. Hint: Use .split() to parse the information
Step by Step Solution
There are 3 Steps involved in it
You can implement the getFlights method in the CSVREADER class like this public class CSVREADER Stri... View full answer
Get step-by-step solutions from verified subject matter experts
