在C#中,以下代码,输出结果为:()
class Hero
{
private string name;
private int attack;
public string Name
{
get;
set;
}
public int Attack
{
get;
set;
}
public Hero(string name)
{
this.Name = name;
this.Attack = 180;
}
}
static void Main(string[] args)
{
Hero hero = new Hero("亚瑟");
Console.WriteLine("姓名:{0},攻击:{1}", hero.Name, hero.Attack);
}
A姓名:"",攻击:0
B姓名:"亚瑟",攻击:0
C姓名:"",攻击:180
D姓名:亚瑟,攻击:180
相关试题
-
在C#中,以下代码,输出结果为:() class Hero { private string name; private int attack;
-
amp;quot;; this.userPwd = "123"; } } static void Main(string
-
在C#中,以下代码运行结果依次为() static void Show() { Console.WriteLine("大家好!&quo
-
在C#中,以下代码输出结果是:() static void Main(string[] args) { Commodity cake = new Commodity();
-
{ Console.Write("B"); } public new void Fun()