Why is the base class being called?
- by oneBelizean
I'm new to c# so bare with me. But here's my situation.
interface Icontainer{
string name();
}
abstract class fuzzyContainer : Icontainer{
string name(){
return "Fuzzy Container";
}
}
class specialContainer: fuzzyContainer{
string name(){
return base.name() + " Special Container";
}
}
Icontainer cont = new SpecialContainer();
cont.name(); // I expected "Fuzzy Container Special Container" as the output.
When I run my code as described above the output is simply "Fuzzy Container". What am i missing here? Is there a better way to get the desired results?