试题详情

在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