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

How big is an int in c#?

605


What is difference between for and foreach in c#?

538


what is generics? can u explain 5 to 6 examples on generics that covers class,method,structure,list,delegates?

1528


Does c# provide copy constructor?

667


What is the data provider name to connect to access database?

585






What is the difference between yield and return?

541


What are abstract classes in c#?

576


Can I do things in il that I can't do in c#?

605


What is a decimal in c#?

614


What is difference between Trace and Debug

654


What are fields in c#?

581


Do we get an error while executing the “finally” block in c#?

595


What is difference between array and arraylist in c#?

532


Explain hash table in c# ?

741


What is public, private, protected, internal and internal protected?

602