Hi Navin & Venkat,
Thanks a lot guys for your respones!!!
Yes,Naveen
There are two situations :
1)If our main method declares as well as throws the exception : In this case it gets compiled but throws exception as venkat correctly said for my above pasted question ,here the answer is A only.
2)If our main method only declares the exception but doesn't throw it , then it gets compiled as well as run , i tried doing it as below :
public class Test6{
public static void main(String args[]) throws Exception{
}
}
i also checked on sun blogs , this (2) is useful for debugging purpose , i didnt get howcome.
:roll:
Now i think i have digested this concept a bit
Thanks guys!!!
Vishal Chugh