/* * * ref is used to state that the parameter passed may be modified by the method. * * in is used to state that the parameter passed cannot be modified by the method. * * out is used to state that the parameter passed must be modified by the method. * * * */ static void Main(string[] args) { // //string s= inRefOut.ReadName(); //inRefOut.SetValueRef(ref s); //inRefOut.IsHeActuallyPratikOUT(out bool truth); //Console.WriteLine("new value of s:" + s + " truth value is: " + truth); InRefOut inRefOut = new InRefOut(); TryingString tryingString = new TryingString(); inRefOut.SetValueRef(ref tryingString.s); inRefOut.SetValueIn(tryingString); bool final = inRefOut.IsHeActuallyPratikOUT(out bool truth); if (final == true) { Console.WriteLine("Successfully implemented"); } else { Console.WriteLine("Not done"); } }
public void SetValueIn(TryingString tryingString) { tryingString.intern = true; }