ExamVeda
Login
Home
Delegates and Events in C Sharp
?

What will be the output of the following C# code snippet?
{
    delegate void A(ref string str);
    class sample
    {
        public static void fun( ref string a)
        {
            a = a.Substring( 7, a.Length - 7);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            A str1;
            string str = "Test Your C#.net skills";
            str1 = sample.fun;
            str1(ref str);
            Console.WriteLine(str);
        }
    }
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.