C#
Programming Language designed by Anders Hejlsberg.
Last updated
Was this helpful?
Programming Language designed by Anders Hejlsberg.
Last updated
Was this helpful?
The parentheses are known as the method invocation operator.
string - for words, phrases, or any alphanumeric data enclosed by double-quotes.
char - for a single alphanumeric character enclosed by single quotes.
int - for a numeric whole number.
decimal - for a number with decimal values and m/M as a literal suffix.
bool - for a true/false boolean values.
Variables are temporary values you store in the computer's memory.
Before you can use a variable, you have to declare it.
To declare a variable, you first select a data type for the kind of data you want to store and then give the variable a name that follows the rules.
You must assign (set) a value to a variable before you can retrieve (get) a value from a variable.
You can initialize a variable by assigning a value to the variable at the point of declaration.
Assignment happens from right to left.
You use a single equals character as the assignment operator.
An implicitly typed local variable is created using the var
keyword. The var
keyword tells the compiler to infer the data type of the variable based on the value it is initialized to.