Variables and Constants

Two of the most fundamental concepts in any programming language are variables and constants. What follows is an in-depth look at these two concepts.

Variables

Variables represent memory areas where data can be stored. The value in a variable can change continuously. Variables can store any kind of data. Each variable has a type. This is specified in the variable declaration statement. The type of the variable is very important, especially in a strongly typed language like C#. The type decides the kind of operations that can be performed on the data contained in the variable.

Note

A strongly typed language is one in which the system defines the types that can be used by the programmers. The system also specifies the ...

Get Special Edition Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.