I created a method named SaveEntry that writes the data in my object array into a file but I'm having dificulties with
throws IOException line. I entered the line at the top which is in red right after i declared the method but when I compile it, it points to the line where I call SaveEntry and gives me this error: "unreported exception java.io.IOException; must be caught or declared to be thrown"
else if (input.equals("SAVE ENTERED DATA"))
//above located in another method
public static void SaveEntry(Vehicle  vehicleArray,int maxInput) throws IOException
String fileInput = JOptionPane.showInputDialog("enter the desired name of the save file");
String fileName = fileInput + ".txt";
FileWriter outputFile = new FileWriter(fileName);
BufferedWriter outputBuffer = new BufferedWriter(outputFile);
PrintWriter printstream = new PrintWriter(outputBuffer);
for(int c=0;c<maxInput;c++ )
}//end SaveEntry method
Is it asking me to put the
throws IOException line where I call SaveEntry? If yes where do i put it? I tried putting it after the brackets but I get errors saying its not a statement and I'm missing a semicolon.
Any help will be greatly appreciated.