What are the two keywords used to pass a variable by
reference in c#?

Answer Posted / sreekanth m

Two keywords are "ref" and "out".

the difference between them are: In the case of "ref", the
passed argument should be initialized first whereas
for "out", its not mandatory.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use void in c#?

468


How many types of inheritance are there in c#?

470


What is the difference between hashtable and dictionary in c#?

474


What is interface used in c#?

581


How many types of delegates are there in c#?

453






What are the steps to create a webservice and consume it?

466


Why do we use abstract class in c#?

480


What is Custom attribute? How to create? If I'm having custom attribute in an assembly, how to say that name in the code?

507


What are accessors?

529


What is sorting in c#?

511


Do void methods have parameters?

485


How does the clr work?

495


Name some string escape sequences in c#.

562


What is an enumerator c#?

506


What are c# attributes and its significance?

516