一个超级简单问题
第一个类,文件名为:test1.cs
内容如下
using System;
public class test1
{
public int a;
public int b;
public test1()
{
a = 0;
b = 1;
}
public int getA()
{
return a;
}
public static void main()
{
Console.WriteLine("a==="+a);
Console.WriteLine("b==="+b);
}
}
第二个类,文件名为:test2.cs
内容如下
using System;
using test1;
public class test2
{
public test2()
{
//
// TODO: Add constructor logic here
//
}
public static void main()
{
test1 aa = new test1();
int b = aa.getA();
Console.WriteLine("b===="+b);
}
}
都放在同一个文件夹下
我想二个类引用第一个类。是怎么做的????