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 use of constructor in c# with example?
What is an array of arrays called?
Is c# an open source?
What do you mean by “finalize” and “finally” methods in c#?
Define clr in .net?
Why do we use generics in c#?
Is exe is machine dependent?
hi, is compulsory .net knowledge need for biztalk server training. if need, how far?.tell me some info abt real time instructors in hyd or other?
What are methods c#?
What is the difference between static class and sealed class in c#?
What are the different types of classes?
What is property c#?
Can abstract class have constructor?
List the differences between method overriding and method overloading?
What is data quality assurance?