adplus-dvertising
frame-decoration

Question

Choose the correct way to call subroutine fun() of the sample class?
class a
{
    public void x(int p, double k)
    {
        Console.WriteLine("k : csharp!");
    }
}

a.

delegate void del(int i);
x s = new x();
del d = new del(ref s.x);
d(8, 2.2f);

b.

delegate void del(int p, double k);
del d;
x s = new x();
d = new del(ref s.x);
d(8, 2.2f);

c.

x s = new x();
delegate void d = new del(ref x);
d(8, 2.2f);

d.

all of the mentioned

Posted under C# programming

Answer: (b).delegate void del(int p, double k);
del d;
x s = new x();
d = new del(ref s.x);
d(8, 2.2f);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Choose the correct way to call subroutine fun() of the sample class?