using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Test
{
public static int i = 0;
public void add()
{
i++;
}
public void addi(int i)
{
i++;
}
public void str(string s)
{
s = "789";
}
public void arr(int[] i1)
{
i1[0] = 1;
}
}
class Program
{
static void Main(string[] args)
{
int i = 0;
int[] i1 = {100};
string s = "123";
Test t1= new Test();
Test t2= new Test();
t1.add();
t2.add();
t1.addi(i);
t1.str(s);
Console.WriteLine(Test.i);
Console.WriteLine(i);
Console.WriteLine(s);
Console.WriteLine(i1[0]);
t1.arr(i1);
Console.WriteLine(i1[0]);
Console.ReadKey();
}
}
}
|