Saturday, August 28, 2010

declaring and initializing variables in c#

 

class VariableDeclarations
{
public static void Main()
{
// Type Identifier Initializer (maximum value)
bool aBool = true;
byte aByte = 255;

decimal aDecimal = 0.99m;
double aDouble = 1.7 * 10308;
char aChar = '\uFFFF';
float aFloat = 3.4f * 1038f;
int aInt = 2147483647;
long aLong = 9223372036854775807;
object aObject = new Object();
sbyte aSbyte = 127;
uint aUint = 4294967295;
short aShort = 32767;
string aString = "Sample";
ushort aUshort = 65535;
ulong aUlong = 18446744073709551615;
}
}

No comments:

Post a Comment