Lets say we have conditions like below. 

A)

```
public void method() throws ... {

      XXXXXXXXXXXXXXXXXXXXXXX;
}

```

or

B)

```
public void method(){

  try{

      XXXXXXXXXXXXXXXXXXXXXXX;
   }catch(...){

      //doing something here
   }

}

```

Assume that line marked with `"XXXX"` is one line of code that may throw an exception(lets assume that this line will not throw an Error). 

So my question is this that, what are the exceptions I should mention in first case( at method declaration) and which exception I should catch in my catch block??

\* I know that just throwing and catching Exception exception is enough but I think that wont be a good design. *\**