Blog

Seleccione el resultado del siguiente código:

class Tree{
public void getName(){Console.WriteLine(“Tree,”);}
}

class DateTree : Tree {
public void getName(){ Console.WriteLine(“DateTree,”); }
}

class OakTree : Tree {
public void getName() { Console.WriteLine(“OakTree,”); }
}

class Program{

static void Main(string[] args) {
Tree t = new Tree();
t.getName();
t = new DateTree();
t.getName();
DateTree t1 = new DateTree();
t1.getName();
OakTree t2 = new OakTree();
t2.getName();
}

}