Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C#

Variables and Constants in C#

Declare locals with var/explicit types and constants with const.

Variables and Constants in C# — a practical guide to C# variables constants with clear examples you can reuse in real projects.

C# Tutorial Series (13/121). Prefer one article? Read the complete C# tutorial.

Short description

Prefer meaningful names; use readonly for instance immutability after construction.

Variables

int count = 0;
const double Pi = 3.14159;
readonly string id;

Leave a reply

Your email address will not be published. Required fields are marked *