OOP is a programming paradigm based on the concept of objects, which can contain data (attributes) and methods (functions) to manipulate that data.
The four basic principles are Encapsulation, Abstraction, Inheritance, and Polymorphism.
Encapsulation is the concept of wrapping data and methods that operate on the data within a single unit (class) and restricting access to some of the object's components.
Inheritance is implemented by creating a base class and deriving subclasses from it, allowing them to inherit methods and properties from the base class.
Polymorphism is the ability of different classes to be treated as instances of the same class through a common interface, typically using method overriding and method overloading.
An abstract class is a class that cannot be instantiated and is meant to be subclassed. It can contain abstract methods (without implementation) that must be implemented by derived classes.
An interface can only declare methods and properties but cannot provide implementation. An abstract class can provide both declarations and implementations. A class can implement multiple interfaces but can inherit only one abstract class.
How does ASP.NET support OOP?.
A constructor is a special method that is called when an instance of a class is created. It is used to initialize the object's data. In ASP.NET, constructors are defined within classes and are called when the class is instantiate.