When you run this code you would see
Before call i = 1
MyMethod i = 2
After call i = 1

Following along, before the call i is set to 1. Then the call is made and because i as not passed ByRef, it is passed by value (ByVal), a copy of the value is sent to MyMethod in a temporary variable also named i – but this a copy not an original.

The method is run, i is altered to be 2 and the message “MyMethod i = 2” printed to the log. Then the method ends, the temporary variable is disposed of and the main code still has the original copy of i so the last message printed showing i is unchanged. To preserve the method’s change back in the caller you need to make the parameter be ByRef and then the actual variable is passed instead of a new temporary being created.

With a reference type (see my earlier post What Kind of Variable Are You if you need any help with that) what we are altering is the contents that are referred to – but not the specific instance that is referred to. So running the code you see this output: