您的位置:首页 > 编程语言 > C#

c#运算符使用,以及装箱拆箱

2011-12-26 21:15 127 查看
 
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#装箱与拆箱
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c# string class object c