Which Of The Following Is The Correct Way To Call The Function #609
Which of the following is the correct way to call the function abc() of the given class in the following C# code?</p> <pre><code class="language-csharp" line="1"> class csharp { public int abc(int a) { Console.WriteLine("A:Just do it!"); return 0; } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Delegates, Generics and LINQ - Delegates in Detail - Quiz No.1.
Which of the following is the correct way to call the function abc() of the given class in the following C# code?
class csharp { public int abc(int a) { Console.WriteLine("A:Just do it!"); return 0; } }
delegate void del(int a); csharp s = new csharp(); del d = new del(ref s.abc); d(10);
csharp s = new csharp(); delegate void d = new del(ref abc); d(10);
delegate int del(int a); del d; csharp s = new csharp(); d = new del(ref s.fun); d(10);
none of the mentioned