Microsoft.NET 2.0 Question:
What is interface and abstract class in .Net?
Answer:
when a class is not provided with full functionalitythen it is declared as abstract.it doesn't support instance creation as well as it cannot be overridable to child class.interface is a colection of methods only without functionality.interface is 90% same as abstract class.
An interface class is a class contains all functions that are are abstract.
An abstract class is a class that may or may not contain an abstract function.
Abstract function : functions with only declaration , no definition is present. the user implimenting, inheriting the function has to override the function , mandatorily.
Instances of abstract class and interface class are made at runtime.so objects cannot be created ,due to lack of informations of the class.
An interface class is a class contains all functions that are are abstract.
An abstract class is a class that may or may not contain an abstract function.
Abstract function : functions with only declaration , no definition is present. the user implimenting, inheriting the function has to override the function , mandatorily.
Instances of abstract class and interface class are made at runtime.so objects cannot be created ,due to lack of informations of the class.
Previous Question | Next Question |
Explain What is the difference between response.redirect & server.transfer? | Explain How to rename a table using sql queries? |