Consider the following function. I have written it in C#.
public void Test()
{
statement1;
try
{
statement2;
}
catch (Exception)
{
//Exception caught
}
}
I want to execute statement1 only if statement2 causes no exception. Is it possible to execute statement1 only when statement2 doesn't throw any exception?
statement1;understatement2;?