public class Fruit { public string Name { get; set; } }
public class Apple : Fruit { }
public static void ReadFruitData(string Name, ref Fruit newFruit)
public static void ReadAppleData(string Name, ref Apple newApple)
Fruit f = (Fruit)newApple;
ReadFruitData(Name, ref f);
public static void Main(string[] args)
ReadAppleData("ab", ref a);
Console.WriteLine("The name of the apple is '{0}'.", a.Name);