zoukankan      html  css  js  c++  java
  • C#求和

    namespace ConsoleApplication3
    {
        class Program
        {
            static void Main(string[] args)
            {
              //  Person2.SayHello();
                Person2 p2 = new Person2();
               int m= p2.AddParams(1, 2, 3, 4);
                //Person2.age
               Person3 p3 = new Person3();
              // p3[0] = 0;
               Console.WriteLine( p3[0] = 0);
                Console.ReadKey();
            }
        }
    
    
        class Person
        {
            private int height;
            public int Height
            {
                get { return height; }
                set { height = value; }
            }
            public int Age;
            private string name;
    
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
    
            public string ReturnName()
            {
                string aa;
                aa = this.name;
                return aa;
    
            }
    
    
            public void GiveName(string Namm)
            {
                this.name = Namm;
            }
    
    
            public void SayHello()
            {
                Console.WriteLine("大家好");
            }
    
        }
         class Person2
        {
            /*成员变量字段,属性,索引,代理,事件,嵌套类,方法。*/
             public static int age;
            public void SayHello() 
            {
                Console.WriteLine("dddd");
            }
    
            public int AddParams(params int[] number)
            {
                int sum = 0;
                foreach (int item in number)
                {
                    sum += item;
                }
                return sum;
            }
        }
         public class Person3
         {
             private int age;
             public int Age
             {
                 get { return age; }
                 set { age = value; }
             }
             public int this[int a]
             {
                 get { return age; }
                 set { age = value; }
             }
    
    
         }
    }
  • 相关阅读:
    Flutter 常用组件
    Chrome扩展应用
    Git操作指南
    ispriter自动构建css-sprite
    Sublime text2插件
    几个实用的sublime text 2的快捷键
    javascript数据类型转换
    requireJs压缩合并路径问题
    机器学习集成学习原理
    sklearn实现决策树算法
  • 原文地址:https://www.cnblogs.com/dark_acme/p/5268785.html
Copyright © 2011-2022 走看看