Posts Tagged ‘variable types’
Thursday, December 29th, 2016
You may have noticed already that some variables can have a default value of null, while others can’t. Well, that is not entirely true. Nullable variable types refers to exactly this situation: creating a specific wrapper around the value types (types that cannot be null), that allow them to store data with a null value.… Read more
Tags: nullable types, variable types, variables
Posted in Introduction | No Comments »
Thursday, December 29th, 2016
Object variable type is a special type, the parent of all other types in the .NET Framework. It can accept values from any other type in C#, and we declare it using the word object.
In the following example you can see how we can assign any type to an object variable type:
…
Read more
Tags: object variable type, variable types, variables
Posted in Introduction | No Comments »
Thursday, December 29th, 2016
In the previous lessons, I’ve said that when declaring a variable, we are required to indicate the compiler the type of the variable and its name. These kind of variables are called explicitly typed variables:
|
int integerVariable = 123; // explicitly typed variable |
However, this is not entirely true.… Read more
Tags: C# keywords, declaring and initializing variables, var, var variable, variable scope, variable types, variables
Posted in Introduction | No Comments »
Wednesday, December 28th, 2016
You should already know by now that the type of a variable defines the interval of values that it can store and the operations that the software can execute upon them. An int type can store, for instance, values ranging from -2,147,483,648 to 2,147,483,647.… Read more
Tags: overflow exception, variable types, variables
Posted in Introduction | No Comments »
Tuesday, December 27th, 2016
As you already learned, C# offers 6 base numeric types (int, byte, char, float, double, decimal). In order to explain type modifiers, you should remember that a type defines a set of values that a variable can store and the kind of operations that the program can perform on them.… Read more
Tags: type modifiers, variable types, variables
Posted in Introduction | No Comments »
Tuesday, December 27th, 2016
Decimal variable type, unlike float and double, which are binary point types, is a floating decimal point type. It can store 128 bits, and compared to the float or double types, it has more precision and a smaller range. This makes it best suitable for financial calculations and any situations where precision is crucial.… Read more
Tags: decimal variable, variable types, variables
Posted in Introduction | No Comments »