Answers for "what is the purpose of the try catch block in java"

0

java try and catch

int midterm;
  System.out.printLn("Enter midterm grade");
  do
  { 
      try {
          string s = in.nextLine();
          midterm = Integer.parseInt(s);
          break;
      }
      catch (Exception e)
      {
          System.out.printLn("Couldn't parse input, please try again");
      }
  }
  while (true);
Posted by: Guest on March-13-2022

Code answers related to "what is the purpose of the try catch block in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language