数据类型详解
——预定义引用类型与用户定义引用类型
namespace ConsoleApp4
{
public struct Department
{
public string name;
public string tel;
}
class Program
{
static void Main(string[] args)
//预定义的引用类型
//(1)object
{
//object是所有类型的根基类
int a = 5;
Console.WriteLine(a);
Department d= new Department();
d.name = "财务部";
Console.WriteLine(d.name);
//(2)string
//思考一下,为什么微软要把string设置成引用类型放堆里????
string name = "Tom";