In the first try block the method m1 is called since the method body throws WhiteException which is a subclass of ColorException it is caught in the corresponding catch block and 'b' is incremented to 1.
In the second try block when the method m2 is called though the exception is declared in the throws clause the method body does not throw any exception hence the next line is executed.
Therefore d is incremented to 1.
Since all the exceptions are handled properly the println statement is executed outputting 0,1,1,0 as a=0,b=1,d=1,f=0
Hope you understood the flow.