const

A modifier for a compile-time constant whose value is fixed in its declaration.

What does const do in C#?

const — A modifier for a compile-time constant whose value is fixed in its declaration.

class Cart
{
    const int MaxItems = 100;
}

Level: Apprentice · More C# terms at this level

Updated

In other subjects