What is the difference between ref and out parameters in c#?



What is the difference between ref and out parameters in c#?..

Answer / Robin Singh

ref parameters allow passing variables to methods by reference, meaning that any changes made inside the method are reflected outside the method as well. On the other hand, out parameters are similar but require initializing them before use and can be used with return values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

what is the difference between interface and multiple interface?

1 Answers   Wipro,


How many types of inheritance are there in c#?

1 Answers  


Explain the term inheritance in C#.

1 Answers   Deloitte, JPMorgan Chase,


What are the benefits of using generics?

1 Answers  


why C++ Partial Object Oriented Programming Language and C# and Java Fully Object Oriented Language

11 Answers   3i Infotech, Alexa, Assyst, Naresh i Technologies, TCS,


What is data set in c#?

1 Answers  


what are the Disadvantages of vb

1 Answers   Digital GlobalSoft,


How to use exception handling in stored procedure?

1 Answers   Wipro,


Can multiple catch blocks be executed?

4 Answers  


Why array is faster than arraylist in c#?

1 Answers  


Is comparator a functional interface?

1 Answers  


Is and as keyword in c# net?

1 Answers  


Categories