C# Programming - Delegates - Discussion

Discussion :: Delegates - General Questions (Q.No.14)


With which of the following can the ref keyword be used?

  1. Static data
  2. Instance data
  3. Static function/subroutine
  4. Instance function/subroutine

[A]. 1, 2
[B]. 3, 4
[C]. 1, 3
[D]. 2, 4
[E]. All of the above

Answer: Option B


No answer description available for this question.

Gloops said: (Aug 4, 2014)  
Can please somebody justify why data should not be accessed by reference when a function needs to modify it.

Sridhar said: (Jun 10, 2018)  
No, we can use the ref keyword only instance method, not a static method.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.