What is the output of the following code ?

static void Main(string[] args)
{
try
{
Console.WriteLine("This is Module 1");
try
{
Console.WriteLine("This is Module 2");
goto exit;
}
finally
{
Console.WriteLine("Module 2 Finished");
}
}
finally
{
Console.WriteLine("Module 1 Finished");
}
exit: ;
}

 Posted by Chvrsri on 7/20/2011 | Category: C# Interview questions | Views: 6259 | Points: 40
Select from following answers:
  1. This is Module 1,This is Module 2,Module 1 Finished,Module 2 Finished
  2. This is Module 1,This is Module 2,Module 2 Finished,Module 1 Finished
  3. This is Module 1,This is Module 2
  4. This is Module 2,Module 1 Finished
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Rspatole on: 9/22/2011 | Points: 10
Thank u so much........

Login to post response