标签:
在文件里面定义一个类,并进行实例化为对象
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HelloWorld { class Recttest { public String test = "My string test"; public void Testfun() { Console.WriteLine("Hello world2"); } } class HelloApp { static void Main(string[] args) { Console.WriteLine("Hello world1"); Recttest r = new Recttest(); r.Testfun(); Console.WriteLine("test=" + r.test); Console.ReadKey(); } } }
标签:
原文地址:http://www.cnblogs.com/sunxun/p/4887284.html