How does VB.NET/C# achieve polymorphism?
Answer Posted / deep
Polymorphism is also achieved through interfaces. Like abstract classes, interfaces also describe the methods that a class needs to implement. The difference between abstract classes and interfaces is that abstract classes always act as a base class of the related classes in the class hierarchy. For example, consider a hierarchy-car and truck classes derived from four-wheeler class; the classes two-wheeler and four-wheeler derived from an abstract class vehicle. So, the class 'vehicle' is the base class in the class hierarchy. On the other hand dissimilar classes can implement one interface. For example, there is an interface that compares two objects. This interface can be implemented by the classes like box, person and string, which are unrelated to each other.
C# allows multiple interface inheritance. It means that a class can implement more than one interface. The methods declared in an interface are implicitly abstract. If a class implements an interface, it becomes mandatory for the class to override all the methods declared in the interface, otherwise the derived class would become abstract.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Define asp.net caching?
What are session state modes in asp.net?
What is difference in .net 1.1 and .net 2.0?
Define xmlreader class.
Explain the difference between asp.net mvc and asp.net webforms
What are the built-in objects in asp.net?
What are the disadvantages of view state?
How can you debug your.net application?
Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?
What is application state?
To get the values in two different controls to match which control you use it?
What is role-based security in asp.net?
Please brief not about xsd,xslt & xml?
Differentiate between authentication and authorization.
What is application variable?