What is the difference between ref & out parameters?

Answers were Sorted based on User's Feedback



What is the difference between ref & out parameters?..

Answer / padam

An argument passed as ref must be initialized before passing
to the method whereas out parameter needs not to be
initialized before passing to a method.

Is This Answer Correct ?    8 Yes 0 No

What is the difference between ref & out parameters?..

Answer / satya

ref keyword is used while passing the parameters by reference.
out keyword is used while passing the parameters by out

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Sharp Interview Questions

Why do we write system in c#?

0 Answers  


How many constructor can a class have?

0 Answers  


Can we inherit partial class in c#?

0 Answers  


Can we inherit class that contains only one private constructor?

0 Answers  


What is writeline?

0 Answers  






What is type safe in c#?

0 Answers  


What are the types of comments in c#?

0 Answers  


What are expressions c#?

0 Answers  


What is a constructor in c#?

0 Answers  


What's the difference between system.string and system.text.stringbuilder classes?

0 Answers  


What do u mean by thread safe?

0 Answers  


Is std :: string null terminated?

0 Answers  


Categories