一道程序运行结果题

 class Car
    
{
        
private int iYear = 0;
        
private string sName = "";
        
public Car()
        


        }

        
public Car(int year, string name)
        
{
            Car oTemp 
= new Car();
            Car oStructure 
= new Car(oTemp);
            
this.iYear = year;
            
this.sName = name;
            Console.WriteLine(
"Structureone");
            Console.WriteLine(
this.iYear );
            Console.WriteLine(
this.sName );
        }

        
public Car(Car ocar)
        
{
            
this.iYear = ocar.iYear;
            
this.sName = ocar.sName;
            Console.WriteLine(
"Structuretwo");
            Console.WriteLine(
this.iYear );
            Console.WriteLine(
this.sName );
        }

   class Program
    
{
        
static void Main(string[] args)
        
{
            Car oCarOne 
= new Car(1983"Eagle");
            Car oCarTwo 
= new Car(oCarOne);
            Console.Read() ;
        }

    }

posted on 2008-03-12 15:44  zencorn  阅读(142)  评论(0编辑  收藏  举报