Why can't I call methods within a class that explicitly implements an interface?
- by tyrone302
Here's the story. I created and interface, IVehicle. I explicitly implemented the interface in my class, Vehicle.cs.
Here is my interface:
Interface IVehicle
{
int getWheel();
}
here is my class:
class Vehicle: IVehicle
{
public int IVehicle.getWheel()
{
return wheel;
}
public void printWheel()
{
Console.WriteLine(getWheel());
}
}
Notice that "getWheel()" is explicitly implemented. Now, when I try to call that method within my Vehicle class, I receive an error indicating that getWheel() does not exist in the current context. Can someone help me understand what I am doing wrong?