Integer Literal เป็นค่าคงฐานสิบ (Decimal) หรือฐานสิบหก (Hexadecimal)
- Prefix
0xหรือ0X= Hexadecimal - ไม่มี Prefix = Decimal
- Suffix
U= Unsigned,L= Long
ตัวอย่าง
200 // int 90u // unsigned int 30L // long
การใช้งาน
int a = 200;
ตัวอย่างโค้ด
using System;
namespace Demo
{
class Program
{
static void Main(string[] args)
{
int a = 200; // Integer literal
Console.WriteLine(a);
}
}
}
Output
200