To access a variable, you simply use the variable name, which must be a valid Java identifier. If there is no such variable, then an error will result when MQL tries to evaluate the expression, and the evaluation process is aborted.
MQL is a loosely-typed language. Variables can be declared before using them, and typed if desired, but neither one of these is necessary. It is up to you to determine if declaring and typing is important.
// gets the value of the variable myName myName