I ran into a strange problem with try catch which got me doubting about my own realization of exception handling fundamentals. As per the basic syntax
try{
code to be checked
}
catch(Exception e){}
finally{}
However the code below gives me a null pointer exception which I believe should have been caught.
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
try{
for(Model m: Null Collection coming from DB)
System.out.println("Inner Block");
System.out.println("Outer Block");
}catch(Exception e){}
}
}