// Declare 3 bools on a single line.
bool b1 = true, b2 = false, b3 = b1;
Console.WriteLine();
}
As well, since the C# bool keyword is simply a shorthand notation for the System.Boolean struc-
ture, it is possible to allocate any data type using its full name (of course, the same point holds true
for any C# data type keyword). Here is the final implementation of LocalVarDeclarations():
static void LocalVarDeclarations()
{
Console.WriteLine("=> Data Declarations:");
// Local variables are declared and initialized as follows:
// dataType varName = initialValue;
int myInt = 0;
string myString;
myString = "This is my character data";
// Declare 3 bools on a single line.
bool b1 = true, b2 = false, b3 = b1;
Do'stlaringiz bilan baham: |