Using a .NET data declaration to declare variable - CSharp Language Basics

CSharp examples for Language Basics:Variable

Introduction

C# Data Type .NET Data Type
sbyteSystem.SByte
byte System.Byte
shortSystem.Int16
ushort System.UInt16
int System.Int32
uint System.UInt32
long System.Int64
ulong System.UInt64
char System.Char
float System.Single
doubleSystem.Double
bool System.Boolean
decimal System.Decimal

Demo Code


////from   w  w  w. jav  a2  s. co m

using System;

class net_vars
{
    public static void Main()
    {

        System.Int32 my_variable = 4;
        System.Double PI = 3.1459;

        Console.WriteLine("\nmy_variable is {0}", my_variable );
        Console.WriteLine("\nPI is {0}", PI );
    }
}

Result


Related Tutorials