zoukankan      html  css  js  c++  java
  • (深入.Net平台和C#编程)第四章.简答题5.20170406

    --------------------------------------角色类--------------------------------------

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace J5.entity
     8 {
     9     class Role
    10     {
    11         public Role(int live)
    12         {
    13             this.Live = live;
    14             Console.WriteLine("创建成功,血量:" + live);
    15         }
    16         public Role(int level, int power, int live)
    17         {
    18             this.Live = live;
    19             this.Level = level;
    20             this.Power = power;
    21             Console.WriteLine("创建成功,等级:{0},战斗力{1}:,血量:{2}",level,power, live);
    22         }
    23         public string Name { get; set; }
    24         public int Level { get; set; }
    25         public int Power { get; set; }
    26         public int Live { get; set; }
    27     }
    28 }
    View Code

    --------------------------------------Main方法--------------------------------------

     1 using J5.entity;
     2 using System;
     3 using System.Collections.Generic;
     4 using System.Linq;
     5 using System.Text;
     6 using System.Threading.Tasks;
     7 
     8 namespace J5
     9 {
    10     class Program
    11     {
    12         static void Main(string[] args)
    13         {
    14             Role r = new Role(10000);
    15 
    16             Role r1 = new Role(999,999999,9999999);
    17         }
    18     }
    19 }
    View Code
  • 相关阅读:
    自己编译GCC(compile gcc from source)
    sphinx PDF 中文
    rst2pdf 中文
    Pandoc PDF 中文
    Linux XMind
    asp.net 邮件发送类
    asp.net 音乐播放器
    使用X-UA-Compatible来设置IE浏览器兼容模式
    asp.net(c#)网页跳转七种方法小结
    C#中HashTable的用法
  • 原文地址:https://www.cnblogs.com/1-2-3-4/p/6675639.html
Copyright © 2011-2022 走看看