c#

好久不用c#了,今天编了一个小程序,感觉好难的,以前就没学好,现在又都忘了

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace qq
{
    class Cpoint
    {
        private int x, y;
        public Cpoint()//构造函数
        {
            x=100;
            y=20;
        }
       public void  Display()//方法
       {
           Console.WriteLine("("+x+","+y+")"); 
       }
       public void setpoint()//方法
       {
           x = 300;
           y = 150;
       }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Cpoint a = new Cpoint();
            a.Display();
            a.setpoint();
            a.Display();
        }
    }
}

  

原文地址:https://www.cnblogs.com/feifeishi/p/5477603.html