日期:2014-05-17 浏览次数:20949 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleTest1.文件夹2;
namespace ConsoleTest1.Program
{
class Program
{
static void Main(string[] args)
{
//通过实例调用
Class1 test= new Class1();
test.funA();
//通过静态方法调用
Class1.funB();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleTest1.Program;
namespace ConsoleTest1.文件夹2
{
class Class1
{
public void funA()
{
Console.WriteLine("这是方法A。");
}
public static void funB()
{
Console.WriteLine("这是静态方法B。");
}
}
}