Answer: </P><P align=justify>With regard to versioning, interfaces are less flexible than classes. </P><P align=justify>With a class, you can ship version 1 and then, in version 2, decide to add another method. As long as the method is not abstract (i.e., as long as you provide a default implementation of the method), any existing derived classes continue to function with no changes. Because interfaces do not support implementation inheritance, this same pattern does not hold for interfaces. Adding a method to an interface is like adding an abstract method to a base class--any class that implements the interface will break, because the class doesn't implement the new interface method.
Tags:Interview Questions, Microsoft, C#,
Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.
Sponsor Advertisement
Customer Resource Management Software
CRM software is designed to help businesses in manageing their customer data and customer interaction, access business information, automate sales, marketing and customer support and also manage employee, vendor and partner relationships. ...
No comments:
Post a Comment