Home » C# Programming » Delegates

Which of the following is the correct way to call subroutine MyFun() of the Sample class given below? class Sample { public void MyFun(int i, Single j) { Console.WriteLine("Welcome to CuriousTab !"); } }

Correct Answer: delegate void del(int i, Single j); del d; Sample s = new Sample(); d = new del(ref s.MyFun); d(10, 1.1f);

← Previous Question Next Question→

More Questions from Delegates

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion