Method Parameters Actual Value C# with Example



Method Parameters Actual Value C# with Example

 using System;

namespace CSharpFundamentals
{
    class MethodParametersFormalValue
    {
        private static void Main(string[] args)
        {
            int value = 100;

            Console.WriteLine("Before Method Execution, value={0}", value);

            ChangeParameters(ref value);

            Console.WriteLine("After Method Execution, value={0}", value);
        }

        static void ChangeParameters(ref int value)
        {
            value = 200;
        }
    }
}
 

0 Comment's

Comment Form

Submit Comment