Hi,
I am trying to explore try catch block. I know a bit about it, but I am confused a little. How can I use multiple catch blocks with a try. And whats the use of finally in try catch block?
I normally use try catch in following way:
try{
...
}
catch(Exception ex)
{
ex.printStackTrace();
}
It serves the purpose for me but I have seen codes where developers mention a specific exception in the catch block. When to use that?
Regards.