Every method absorbs specific use cases for pass by memory address:
"ref" passes the memory address and states the parameter may be modified by the method;
"in" states the parameter passed cannot be modified by the method;
"out" states the parameter passed must be modified by the method.
Code examples:
static void Enroll(ref Student student)
{
student.Enrolled = true;
student = new Student();
student.Enrolled = false;
}
static void Enroll(out Student student)
{
student = new Student();
student.Enrolled = false;
}
static void Enroll(in Student student)
{
student.Enrolled = true;
}