1. This should be used when you re-instantiate the object inside function.
2. This should be used, if your object is string or any value type Object.
Class1 ObjClass = new Class1();
ObjClass.StrA = 55;
GetA(ref ObjClass);
int ss = ObjClass.StrA; //ss value is 99 after re-instatiate inside function
private void GetA(Class1 ObjClass)
{
ObjClass = new Class1();
ObjClass.StrA = 99;
}
No comments:
Post a Comment