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
What is the default scope of a class in c#?
What is lambda expression in c#?
What is difference between function and method in c#?
What is a nested type. Give an example?
What is the difference between an application domain and a process?
What is enumerable in c#?
What is collection class c#?
What is the difference between field and property in c#?
Explain the ways to deploy an assembly?
How long will it take to learn c#?
What is the difference between finalize() and dispose() methods?
What is c# console application?
i want o/p 011242110 in c# code.
Why dataset is used in c#?
What is native image generator (ngen.exe)?