Admin
Investor Persona
File name: catcherror.java
- Code:
import java.io.*;
public class catcherror{
public static void main(String[] args)throws IOException{
int inp;
try{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Your Favourite Color:");
System.out.println("[1] Blue");
System.out.println("[2] Red");
System.out.println("[3] Yellow");
inp = Integer.parseInt(input.readLine());
} catch(Exception e){
System.out.println("Wrong Input.");
System.out.println("Please Enter the Following Number.");
}
}
}
No Comment.