---restore content starts---
1============ Wizard Class =============2 usingSystem;3 usingSystem.Collections.Generic;4 usingSystem.Linq;5 usingSystem.Text;6 usingSystem.Threading.Tasks;7 8 namespacej5.entity9 {Ten /// <summary> One ///Wizarding Class A /// </summary> - Public classWS - { the Public stringJibie {Get;Set; }//level - Public intZhandou {Get;Set; }//Combat Effectiveness - Public intshenming {Get;Set; }//Health Value - /// <summary> + ///Construct a - /// </summary> + PublicWS () A { at This. Shenming =10000; - } - /// <summary> - ///Construction Two - /// </summary> - /// <param name= "JB" ></param> in /// <param name= "ZDL" ></param> - /// <param name= "SM" ></param> to PublicWS (stringJbintZdlintSM) + { - This. Jibie =JB; the This. Zhandou =Zdl; * This. Shenming =SM; $ }Panax Notoginseng - /// <summary> the ///Display Information + /// </summary> A Public voidInfo () the { +Console.WriteLine ("The wizard's level is: {0}, fighting capacity is: {1}, Health value: {2}", Jibie, Zhandou, shenming); - } $ } $}View Code
1=========== Test Class ===========2 usingSystem;3 usingSystem.Collections.Generic;4 usingSystem.Linq;5 usingSystem.Text;6 usingSystem.Threading.Tasks;7 usingj5.entity;8 9 namespaceJ5Ten { One class Program A { - Static voidMain (string[] args) - { theWS WS =NewWS (); -Ws. Jibie ="Intermediate";//level -Ws. Zhandou = -;//Combat Effectiveness - ws. Info (); + Console.WriteLine (); -WS ws1 =NewWS ("Intermediate", the,99999); + ws1. Info (); A Console.read (); at - } - } -}View Code
S2t40. Depth. NET platform and C # programming) Chapter fourth. Brief answer 5. Lixiangyang. 20170406