I tried a simple code where user has to input a number. If user inputs a char it l produce numberformatexecption. That works fine. Now when i remove try catch block it shows error. What is the meaning of the error The code and error as follows
import java.io.*;
class execmain
{
public static void main(String[] args)
{
//try
//{
int a;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
a=Integer.parseInt(br.readLine());// ---------error-unreported exception must be caught/declared to be thrown
System.out.println(a);
//}
//catch(IOException e)
//{
//System.out.println(e.getMessage());
//}
}
}
Why this error comes?