zoukankan      html  css  js  c++  java
  • S2T40,第四章,简答4

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace Emmet
     8 {
     9     class emmet
    10     {
    11         public emmet(string name)
    12         {
    13             this.Name = name;
    14         }
    15 
    16         public string Name { get; set; }
    17 
    18         public void showInfo()
    19         {
    20             Console.WriteLine("大家好!我是一只小蚂蚁,名叫"+this.Name);
    21         }
    22 
    23         public void FindDessert(Dessert dessert)
    24         {
    25             Console.WriteLine("我找到一块甜品:"+dessert.dessertName);
    26         }
    27 
    28         public void CarryDessert()
    29         {
    30             Console.WriteLine("现在,大家搬运甜品!");
    31             Console.WriteLine("我们完成寻找甜品的任务!");
    32         }
    33     }
    34 }
    蚂蚁类
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace Emmet
     8 {
     9     class Dessert
    10     {
    11         public Dessert(string dessertName)
    12         {
    13             this.dessertName = dessertName;
    14         }
    15 
    16         public string dessertName { get; set; }
    17     }
    18 }
    甜品类
     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace Emmet
     8 {
     9     class Program
    10     {
    11         static void Main(string[] args)
    12         {
    13             emmet Emmet = new emmet("小不点");
    14             Dessert dessert = new Dessert("提拉米苏");
    15             Emmet.showInfo();
    16             Emmet.FindDessert(dessert);
    17             Emmet.CarryDessert();
    18 
    19             Console.Read();
    20 
    21         }
    22     }
    23 }
    测试类
  • 相关阅读:
    服务器基础知识
    web服务器与应用服务器
    QGraphics
    对话框Dialog
    信号和槽
    nginx 杂记
    go语言nsq源码解读八 http.go、http_server.go
    go语言nsq源码解读七 lookup_protocol_v1.go
    go语言nsq源码解读六 tcp.go、tcp_server.go
    go语言nsq源码解读五 nsqlookupd源码registration_db.go
  • 原文地址:https://www.cnblogs.com/lzx666/p/6676022.html
Copyright © 2011-2022 走看看