In C#
, how does a try catch finally block work?
So if there is an exception, I know that it will jump to the catch block and then jump to the finally block.
But what if there is no error, the catch block wont get run, but does the finally block get run then?
Yes, the finally block gets run whether there is an exception or not.
See: http://msdn.microsoft.com/en-us/library/fk6t46tz%28v=vs.80%29.aspx
finally block always run , no matter what. just try this method
Yes the finally clause gets exeucuted if there is no exception. Taking an example
So here if suppose an exception occurs also the finally gets executed.