Sunday, February 25, 2018

Java program : Checked and Unchecked Exceptions

class CheckedException
{
    public static void main(String[] args) throws Exception
    {    Thread.sleep(3000);  //CHECKED exception
        System.out.println("Singh");
        System.out.println(10/0);    //UNCHECKED exception
        System.out.println("ashu");
    }


}

Thanks
Happy programming!

No comments:

Post a Comment

Sacred Thought

5 May 2024 Hari Om Verse 50-51, chapter two:  In this chapter two Shree krishna explains a simple way of living. Free from desires and void ...