面向对象之struct

    struct PointStruct
    {
        int pointx = 1;
        int pointy = 2;

        public PointStruct(int x, int y)
        {
            this.pointx = x;
            this.pointy = y;
        }
    }
    public class test
    {
        PointStruct s = new PointStruct();
    }

  struct是值类型,用来封装一组数据和一些简单处理数据的方法

posted on 2016-03-17 10:54  jianiu  阅读(251)  评论(0编辑  收藏  举报