WindowsFormsApp1/Program.cs
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new calculator());
//接口实现多态
Person persion = new Person();
Cat cat = new Cat();
persion.eat();
persion.work();
((eat)persion).sleep();
((work)persion).sleep();
cat.eat();
cat.sleep();
//继承实现多态
Son1 son1 = new Son1();
Son2 son2 = new Son2();
Son3 son3 = new Son3();
son1.put();
son2.put();
son3.put();
//实现泛型队列
Person x = new Person();
Queue<Person> queue = new Queue<Person>();
Person p4 = new Person();
Person p5 = new Person();
Person p6 = new Person();
queue.Enqueue(p4);
queue.Enqueue(p5);
queue.Enqueue(p6);
x = queue.Dequeue();
Console.WriteLine("名字:{0},年龄:{1}", x.name, x.age);
//实现泛型栈类
Person e = new Person();
Stack<Person> stack = new Stack<Person>();
Person p1 = new Person();
Person p2 = new Person();
Person p3 = new Person();
stack.Push(p1); stack.Push(p2); stack.Push(p3);
e = stack.Peek();
后面还有 6 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。