---
title: "Discussion on \"C# : Constants vs Readonly Fields\" | Hashnode"
description: "Discussion on \"C# : Constants vs Readonly Fields\". In C#, both constants and readonly fields are used to store values that should not change after assignment, but they differ in how and when their values are set, as well as how they are handled by the compiler. Understanding these differences is key ..."
url: "https://hashnode.com/posts/c-constants-vs-readonly-fields/670957921cfc33e6cf30766f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [C# : Constants vs Readonly Fields](https://techkeys.hashnode.dev/c-constants-vs-readonly-fields?utm_source=hashnode&utm_medium=feed)

In C#, both constants and readonly fields are used to store values that should not change after assignment, but they differ in how and when their values are set, as well as how they are handled by the compiler. Understanding these differences is key ...

Oct 3, 2024 · 3 min read · techkeys.hashnode.dev  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#net](https://hashnode.com/tag/net)
-   [#tech](https://hashnode.com/tag/tech)

## Written by

[Madhu Kumari](https://hashnode.com/@MADHUKUMARI)

@MADHUKUMARI

  
[View profile](https://hashnode.com/@MADHUKUMARI)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
