C#第三天-静态变量static

namespace gowater
{
    class Person {
       public int _age;
       public string _name="jj";
        public static int s_maxAge = 150;
    }
    class Program
    {
        static void Main()
        {
            int a = 10;
            Person P=new Person();
            P._age = 45;
            P._name = "xiong";
            Console.WriteLine($"{P._age} is {P._name}");
        }
    }
}

  

posted @ 2026-08-05 13:01  华腾智算  阅读(4)  评论(0)    收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL