开发者

Vb.net Try Finally (no catch) [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

Quiz question: What is the output of running the following program:

 Sub Main()
      Try
         CallToMethodThatThrowsException()
      Catch ex As ArgumentException
         Console.WriteLine("Argument exception caught")
      Finally
         Console.WriteLine("Outer finally block")
      End Try
   End开发者_运维技巧 Sub

   Public Sub CallToMethodThatThrowsException()
      Try
         ThrowExceptionMethod()
      Finally
         Console.WriteLine("Inner finally block")
      End Try
   End Sub

   Public Sub ThrowExceptionMethod()
      Throw New ArgumentException()
   End Sub

No code writing please :) - the first to answer correctly gets the big prize (an accepted answer :) )


I'd assume:
inner finally block
argument exception caught
outer finally block


"Inner finally block"
"Argument exception caught"
"Outer finally block"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜