---
title: "Difference between ref and out keyword in c#."  
description: "Difference between ref and out keyword in c#."  
author: "James Smith"  
published: 2011-05-20  
updated: 2011-05-20  
canonical: https://www.mindstick.com/forum/253/difference-between-ref-and-out-keyword-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Difference between ref and out keyword in c#.

Hi...\
Can any one [explain me](https://www.mindstick.com/forum/34220/can-anyone-explain-me-about-off-page-activity) that what is [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between [ref and out keywords](https://www.mindstick.com/forum/33947/difference-between-ref-and-out-keywords) in c#.

## Replies

### Reply by Anonymous User

[Ref](https://www.mindstick.com/interview/217/what-is-the-difference-between-ref-out-parameters) tells the compiler that the object is initialized before entering the function, while out tells the compiler that the object will be initialized inside the function.


---

Original Source: https://www.mindstick.com/forum/253/difference-between-ref-and-out-keyword-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
