Answer Posted / dharmendra kumar
Interface is a syntactical contract that all the derived
classes should follow.
public interface MotorStateObject
{
int State{ get;}
void Running();
void Stop();
int Speed { set;get; }
}
public class Car : MotorStateObject
{ .....
}
public class Bike : MotorStateObject
{......
}
public class Bus : MotorStateObject
{......
}
public class MotorState()
{
public void applybrake(MotorStateObject Object)
{
MotorStateObject.Stop();
}
}
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com
How do I simulate optional parameters to com calls?
Is constructor a static method?
What is datetime parse in c#?
what is object-oriented programming (oop) language?
What exactly happens when we debug and build the program?
What is virtual in c#?
How is a strongly-named assembly different from one that isn’t strongly-named?
What Is An Interface Class?
Explain the access modifiers in c#?
Explain the types of comments in c#?
How do you escape in c#?
Is a c# interface the same as a c++ abstract class?
What does void mean in c#?
Can you have parameters for static constructors?