Question:Which of the following statements are true regarding the ref and out parameters in C#? 

A A variable that is passed as an out parameter needs to be initialized, but the method using the out parameter does not need to set it to something. 

B The out parameter can be used to return the values in the same variable passed as a parameter of the method. Any changes made to the parameter will be reflected in the variable. 

C The ref keyword can only be used on one method parameter. 

D The ref parameter is considered initially assigned by the callee. As such, the callee is not required to assign to the ref parameter before use. Ref parameters are passed both into and out of a method. 

+ Answer
+ Report
Total Preview: 865

Copyright © 2024. Powered by Intellect Software Ltd