2. Using variables
Memory is allocated to a variable at the time of its creation.
Syntax:
<datatype> <variableName>;
int empNumber;
empNumber = 100;
string empName = “M. Nolan”;
3. Data Types
Value Types
store actual values.
the values are stored
in stack.
int, float, double, …
Reference Types
store the memory address
of other variables
in heap
string, class
4.
5. Classification
Object
String
Class
Delegate
Interface
Array
14. Constants
possible to declare constants for all data types.
have to initialize a constant at the time of its declaration.
The compiler identify constants at the time of compilation
15. Using Literals
A literal is a static value assigned to variables and constants.
Numeric literals might suffix with a letter of the alphabet to indicate
the data type of the literal.
Boolean => bool
Integer => int, uint (u), long (l), ulong (ul or lu)
long val = 53L;
Real => float(f), double(d), decimal(m)
float val = 1.66f;
Character
String => regular or verbatim.
Null
20. Console Operations
are tasks performed on the command line interface.
All console application consist of three streams
Standard in
Standard out
Standard err