using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 運算符
{
class Program
{
static void Main(string[] args)
{
Single a = 100.1F;
Single b = 200.2F;
bool c = a == b;
Console.WriteLine(c);
bool d = a < b;
Console.WriteLine(d);
Console.ReadLine();
}
}
}
C#的運算符。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 裝箱與拆箱
{
class Program
{
static void Main(string[] args)
{
int i = 2009;
object a = i;//裝箱
Console.WriteLine(a);
int j = (int)a;//拆箱
Console.WriteLine(j);
Console.ReadLine();
}
}
}
c#裝箱與拆箱