throwa vs catch and throw

PHOTO EMBED

Thu Jan 18 2024 07:55:54 GMT+0000 (Coordinated Universal Time)

Saved by @E23CSEU1151 #java

class D
{
   public static void Wait() throws InterruptedException
    {
        for(int i=0;i<=10;i++)
        {
            System.out.println(i);
            Thread.sleep(1000);
            
        }
    }
    public static void main(String[] args) 
{
    try
    {
        Wait();
        System.out.println(10/0);
       
    }
    catch(Exception s)
    {
        System.out.println("some error find");
    }
}
}
content_copyCOPY