public abstract class Vehicle
{
public int speed = 1;
public void PrintSpeed()
{
Console.WriteLine(speed);
}
}
public class Car : Vehicle
{
public int speed = 9;
public void DoSomething()
{
// ....
PrintSpeed(); // Here it prints 1, but I want it to print 9
}
}
public abstract class Vehicle
{
public int speed = 1;
public void PrintSpeed()
{
Console.WriteLine(speed);
}
}
public class Car : Vehicle
{
public int speed = 9;
public void DoSomething()
{
// ....
PrintSpeed(); // Here it prints 1, but I want it to print 9
}
}