Basic review------namespace import and access class object methods

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using N1;


namespace Test02
{
    class Program
    {
        static void Main(string[] args)
        {
            A oa = new A(); //Example Instantiate class A in N1
            oa.Myls(); //Call the Myls method in class A
        }
    }
}












namespace N1 //Create namespace N1
{
    class A //Instantiate class A in namespace N1
    {
        public void Myls ()
        {
            Console.WriteLine("Download you for the rest of my life"); //Output string
            Console.ReadLine();
        }
    }
}

Guess you like

Origin blog.csdn.net/u014156887/article/details/37873539