using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _04结构体
{
class Program
{
static void Main(string[] args)
{
//设置控制台字体颜色
Console.ForegroundColor = ConsoleColor.Black;
Console.BackgroundColor = ConsoleColor.Yellow;
//不new 就能用是有条件的, !1 必须是公有的成员变量,2不能是私有再封装的
Student stu;
stu.age = 20;
stu.Say();
Console.ReadKey();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _04结构体
{
public struct Student
{
public int age;
public void Say()
{
Console.WriteLine("Say");
}
}
}
.NET结构体
最新推荐文章于 2024-02-07 11:16:19 发布
