Based on the following snippet,
answer the following questions:
- What is the value
of returnValue when the last
line of Test executes?
- What value is
returned from the Test function?
- Would the
code in the Finally block
execute?
- How many Return statements (or Exit Function or Exit Sub) should a function have?
Module Module1
Sub Main()
Dim x As Integer = Test()
End Sub
Function Test() As Integer
Dim returnValue As Integer
Try
returnValue = 1
Return returnValue
Catch ex As Exception
returnValue = 2
Finally
returnValue = 3
End Try
Return returnValue
End Function
End Module