Answer to Question #15672 in C# for Zulekha
& static void Main(string args)
Human user = new User();
Human person = new Person();
* Define a interface ‘Human’ with methods as walk’ and ‘speak’.
*& Define aclass ‘User’ implementing ‘Human’. Define a work()
* method in User class.Add a class ‘Person’ also implementing
* Human. Add a method ‘Behave’ inPerson class. In Main method
* create objects of Person and User andassign them to ‘Human’
* type and call Human methods.
* Can the work andBehave methods be called through Human types?
* No, they can't, because these methods are not defined for the
* interface Human, in program we are working with instances
* of User and Person classes as objects of Human type.
* Can we create theinterface objects by calling interface Constructors?
* No. The interface is similar to a class, except that none of
* its members is not implemented. The interface includes methods,
* properties, events, and indexers. For it is impossible to
* create an instance of all that it contains, - the signature
* of its members. It's like completely abstract class with out
* any realizations of methods.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!