Thursday, March 16, 2017

UnCaught Exception

Tags

Exception is a run time error which is caused due to Programmer error,Input error and others abnormal condition which leads to termination of the program.

UnCaught Exception is that which is handled by java run time system by default handler and leads to abnormal termination of program.

Code::

import java.util.*;
public class Exception 
{

    
    public static void main(String[] nt) 
    {
        Scanner in =new Scanner(System.in);
        System.out.print("Enter any Number:");
        int a=in.nextInt();
        int b=12345/a;
        System.out.println("Result is :"+b);
    }
    
}

Output::