Console.WriteLine(Name+" "+ Age.ToString());
在emp.Information();
下面加一句Console.WriteLine();并在该句设一下断点就可以看到了

解决方案 »

  1.   

    public void Information(string strName, int intAge)
    {
    Console.WriteLine("输入名字或年龄");   \\增加这一行就知道了
    Name=Console.ReadLine();
    Age=Console.ReadLine();
    Console.WriteLine(Name,Age);}
      

  2.   

    using System;
    class Employee
    {string Name;
    string Age;
    public void Information()
    {Console.WriteLine("李克勤");}
    public void Information(string strName, int intAge)
    {
    Name=Console.ReadLine();
    Age=Console.ReadLine();
    //Console.WriteLine(Name,Age);
    改为Console.WriteLine(Name+" "+ Age.ToString());}static void Main()
    {
    Employee emp=new Employee();
    emp.Information("李白",800);emp.Information();
    Console.WriteLine();
    }
    }
      

  3.   

    加句:
      System.Console.Read();
      

  4.   

    using System;
    class Employee
    {string Name;
    string Age;
    public void Information()
    {Console.WriteLine("李克勤");}
    public void Information2(/*string strName, int intAge*/)
    {
    Console.WriteLine("please type new employee's name :");
    this.Name=Console.ReadLine();
    Console.WriteLine("please type new employee's age:");
    this.Age=Console.ReadLine();
    Console.WriteLine("the new employee's name:{0}:",this.Name);
    Console.WriteLine("the new employee's arg:{0}:",this.Age);}
    原程序升级1.0
      

  5.   

    using System;
    class Employee
    {string Name;
    string Age;
    public void Information()
    {Console.WriteLine("李克勤");}
    public void Information2(/*string strName, int intAge*/)
    {
    Console.WriteLine("please type new employee's name :");
    this.Name=Console.ReadLine();
    Console.WriteLine("please type new employee's age:");
    this.Age=Console.ReadLine();
    Console.WriteLine("the new employee's name:{0}:",this.Name);
    Console.WriteLine("the new employee's arg:{0}:",this.Age);}static void Main(/*string[] args*/)
    {
    Employee emp=new Employee();
    emp.Information2(/*"李白",800*/);emp.Information();
    }
    }
    应该是这个,谢谢你的学习素材
      

  6.   

    public void Information(string strName, int intAge)
    {
    Name=Console.ReadLine();
    Age=Console.ReadLine();
    Console.WriteLine(Name,Age);
    }
    应该是这个函数错误,因为此函数的两个参数在函数中你根本没有用过,而你用了类中的两个相关的属性,因此在后面的emp.Information("李白",800)中“李白”和“800”就无法显示了,而你在实例类也也没有对类的两个属性进行初始化,所以当然为空了。
    此函数应改为:
    public void Information(string strName, int intAge)
    {
    strName=Console.ReadLine();
    strAge=Console.ReadLine();
    Console.WriteLine(Name,Age);
    }
      

  7.   

    public void Information(string strName, int intAge)
    {
    strName=Console.ReadLine();
    strAge=Console.ReadLine();
    Console.WriteLine(atrName,strAge);
    }
      

  8.   

    to sjhcsharp(C#):为什么不行?何为一个是执行时,一个是运行时?