Hello Matt, thanks for another great lesson! I have a question. While passing a value to the invoked method in Anonymous Apex window, you often do it in a form: (name: value). It doesn't work for me for some reason. For instance, at 6-45 you typed switchExample(i:5). Would you please shred a light on what is i: and why it is there? On my side the code works only if I just put the value to be passed, so in the example above it would be switchExample(5). Thank you!
He did not typed the 'i:', it's the feature of IntelliJ IDE of hinting the parameter's name. If you look closely, you see that 'i:' is faded a bit. In IntelliJ, when you call a method and pass a direct value to it, it just shows the name of the parameter, in that case it's just an 'i' because that's how the called method is defined. It's called Parameter Hints or Inlay Hints. If Matt's method would look like "switchExample(Integer aNumberToCheck)", the code in Anonymous Windows would display "switchExample(aNumberToCheck: 5)"