import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be greater than 0!");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}
System.out.println("After Try");
}
}
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be greater than 0!");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be greater than 0!");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
Finally Block After Try
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
5
Output:
Finally Block After Try
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be...
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be...
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be... Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be... Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be... Finally Block After Try
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
-5
Output:
Input must be... Finally Block After Try
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input..
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input..
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input.. Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input.. Finally Block
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input.. Finally Block After Try
import java.util.Scanner;
import java.util.InputMismatchException;
import java.lang.IllegalArgumentException;
public class Finally{
public static void main(String[] args){
Scanner reader;
reader = new Scanner(System.in);
try{
int x = reader.nextInt();
if(x < 0){
throw new IllegalArgumentException("Input must be...");
}
}catch(InputMismatchException e){
System.out.println("Error: Must input an integer!");
}catch(IllegalArgumentException e){
System.out.println(e.getMessage());
}finally{
System.out.println("Finally Block");
}
System.out.println("After Try");
}
}
Input:
abc
Output:
Error: Must input.. Finally Block After Try