Professional Documents
Culture Documents
Import Java - uti-WPS Office
Import Java - uti-WPS Office
Scanner;
import java.io.*;
//main mehtod
public static void main(String[] args) {
//creating match object
AFLTeam aflMatch = new AFLTeam();
try
{
//reading home team linup from home linup file
BufferedReader br = new BufferedReader(new FileReader(homeLineupFile));
while (strLine != null)
{
strLine = br.readLine();
sb.append(strLine);
sb.append(System.lineSeparator());
strLine = br.readLine();
if (strLine==null)
break;
aflMatch.homeTeamLineup[index] = strLine;
index++;
}
br.close();
index = 0;
//reading away team lineup for file
br = new BufferedReader(new FileReader(awayLineupFile));
while (strLine != null)
{
strLine = br.readLine();
sb.append(strLine);
sb.append(System.lineSeparator());
strLine = br.readLine();
if (strLine==null)
break;
aflMatch.awayTeamLineup[index] = strLine;
index++;
}
br.close();
}
catch (FileNotFoundException e)
{
System.err.println("File not found");
}
catch (IOException e)
{
System.err.println("Unable to read the file.");
}