Concept 001 :
ref tells the compiler that the object is initialized before entering the function, while
out tells the compiler that the object will be initialized inside the function.
ref is two-ways,
out is out-only.
Concept 002 :
ref modifier means that:
- The value is already set and
- The method can read and modify it.
out modifier means that:
- The Value isn’t set and can’t be read by the method until it is set.
- The method must set it before returning.
For more detail click here.