热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_54207438
P____mmmmm
4 年前
trueweixin_54207438

方配在线考试系统v4.0答题,按F12打开脚本后,怎么找正确答案?

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
显示成员名称不能与他们的封闭类型相同 ,怎么改呀大佬们🙊namespace ConsoleApplication5{ class Program { static void Main(string[] args); class Program{ static void Main(string[] args){ Student stu = new Student(); stu.Age = -30; stu.Gender = "女"; stu.Introduce(); Console.ReadKey(); } } } public class Student { private string name = "张三"; public string Name { get { return name; } } private int age; public int Age { get { return age; } set { if (value <= 0) { Console.WriteLine("年龄不合法..."); } else { age = value; } }} public string Gender {get; set; } public void Introduce() { Console.WriteLine("大家好,我叫" + Name + ",我是" + Gender + "生,今年" + Age + "岁!"); }} }
立即登录