using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
//本程序试验了值类型和引用类型的差异,值类型变量是不能直接修改的,只有通过其变量引用才能对内存中的值进行修改
namespace ref_value
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("<------值类型和引用类型测试开始------>");
int a = 1;
Change(a);
//Change(ref a);//此处为添加ref后代码
Console.WriteLine(a);
int[] b ={1};
Change(b);
Console.WriteLine(b[0]);
string c = "1";
Change(c);
Console.WriteLine(c);
StringBuilder d = new StringBuilder();
Change(d);
Console.WriteLine(d);
Stopwatch sw = new Stopwatch();
sw.Start();