Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Is there any other reference type than string that you could use as a constant?
    – springy76
    Commented Aug 19, 2016 at 13:02
  • You can have const with reference types other than string, but the constant can only have the value null. Commented Apr 27, 2018 at 14:28
  • @user1333 You're confusing a dereferenced value with the referenced value. The instance in your example, the read-only value, is a Char[]. The value you're changing in the first update statement is content accessed through the reference, not the reference itself.
    – Suncat2000
    Commented Sep 22, 2020 at 12:46