Question: java code 4. The following program displays the maximum of the sequence of positive integer numbers that are saved on the positive.txt. Write a java

 java code 4. The following program displays the maximum of the

java code

4. The following program displays the maximum of the sequence of positive integer numbers that are saved on the positive.txt. Write a java program that changes the standard message to a customized message for the exceptions that may occur in the given code. (30 pts.) public class Maximum { public static void main (String args[]) throws IOException BufferedReader ob =new BufferedReader (new FileReader("positive.txt")); // can produce FileNotFoundException int maximum = -1; String line = ob.readLine(); // can produce IOException while (line != null) { int n = Integer.parseInt(line); // can produce Number FormatException if (n > maximum) maximum = n; line = ob.readLine(); // can produce IOException} System.out.println("Maximum = + maximum); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!