Re: Verify my test result
#1 is 20. Because the first run its 7 (2+3+2). Then because of the =+ it means to add to its previous value. The second call passing 5 as x adds to the previous values of the variables but because of the Static Dim y As Integer it will retain its previous value. So x = 5, y = 6 (3+3), and z = 2. 7 + 13 = 20.
I'd say #2 and #3 are correct.
#4 is 36 elements.
#7. arrays must contain elements all of the same type.
Re: Verify my test result
HI! Thanks for the response.
#3 is about scope type. Based on the article I've read, Class would be "best" choice. If you have other comments/explanation I will be glad to hear it.
#4 why would you say it's 36? isn't it 2*3*2=12
So what would be your comment abour the result? MSDN said that I only got 6 correct answers. There's no problem about that if I could only understand my mistakes.
Thanks :thumb:
Re: Verify my test result
#4 is 36, and not 12 because arrays are zero-based in .NET.
Therefore an array defined as (2, 3, 2) has 'dimensions' with a size of:
3 elements (0, 1 and 2)
4 elements (0, 1, 2 and 3)
3 elements (0, 1 and 2)
So the number of elements in total is 3*4*3 = 36.