标红处的v=c是什么意思
一匹野狼 2010-10-31 03:44:17 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace test
{
class Program
{
static void Main(string[] args)
{
Vehlcle v;
Car c;
v = new Vehlcle();
c = new Car();
v.drive();
c.drive();
v = c; v.drive();
Console.ReadLine();
}
}
class Vehlcle
{
public void drive()
{
Console.WriteLine("Vehlcle:drive");
}
}
class Car : Vehlcle
{
public void drive()
{
Console.WriteLine("Car:drive");
}
}
}