Ravan Kumar wrote:i know this is checked exception but how to identify that there i have to declare it otherwise code wont compile ? i am just using methods i don't know their source code.
The javadoc for that method tells you what checked exceptions it throws. The javadocs for each of those exceptions tell you whether they are checked or unchecked. Knowing the basic rules of checked and unchecked exceptions in
Java tells you that you have to catch or declare the checked exceptions that method can throw. There's no need for its source code.