parent
e81c6eac3d
commit
07f7a0b696
5 changed files with 61 additions and 5 deletions
@ -1 +1,9 @@ |
||||
# Abstract classes |
||||
# Abstract Classes |
||||
|
||||
An abstract class is a class in object-oriented programming (OOP) that cannot be instantiated. Instead, it serves as a template or blueprint for other classes to inherit from. An abstract class can contain both abstract and non-abstract methods (abstract methods are methods that do not have any implementation, they just have a signature). |
||||
|
||||
Abstract classes are used to provide a common interface and implementation for a group of related classes. They are also used to define common behavior that must be implemented by all subclasses. A subclass that inherits from an abstract class is called a concrete class, and it must provide an implementation for all the abstract methods declared in the parent class. |
||||
|
||||
Learn more from the following resources: |
||||
|
||||
- [What is an Abstract Class in Object Oriented Programming](https://computinglearner.com/abstract-class-in-object-oriented-programming/) |
@ -1 +1,10 @@ |
||||
# Concrete classes |
||||
# Concrete Classes |
||||
|
||||
A concrete class is a class in object-oriented programming (OOP) that can be instantiated, meaning objects can be created from it. A concrete class is a class that provides an implementation for all of the abstract methods declared in its parent class, if it inherits from an abstract class. A concrete class can also be a class that does not inherit from an abstract class, in that case it can have implementation for all of its methods. |
||||
|
||||
Concrete classes are used to provide specific implementation details for a group of related classes that inherit from a common abstract class. They are also used to define unique behavior for a specific class. A concrete class can have its own methods and variables, and can also override the methods of its parent class. |
||||
|
||||
Learn more from the following resources: |
||||
|
||||
- [Concrete class in Java](https://www.geeksforgeeks.org/concrete-class-in-java/) |
||||
- [Overview of Concrete Class](https://www.sciencedirect.com/topics/computer-science/concrete-class) |
@ -1 +1,13 @@ |
||||
# Scope visibility |
||||
# Scope Visibility |
||||
|
||||
Scope visibility refers to the accessibility or visibility of variables, functions, and other elements in a program, depending on the context in which they are defined. In object-oriented programming (OOP), scope visibility is controlled through the use of access modifiers, such as "public," "private," and "protected." |
||||
|
||||
- Public: A public element can be accessed from anywhere in the program, both within the class and outside of it. |
||||
- Private: A private element can only be accessed within the class in which it is defined. It is not accessible to other classes, even if they inherit from the class. |
||||
- Protected: A protected element can only be accessed within the class and its subclasses. |
||||
|
||||
There are variations of scope visibility based on the programming language, but these are the most common. |
||||
|
||||
Learn more from the following resources: |
||||
|
||||
- [Scope, Visibility and Lifetime of Variables](https://www.youtube.com/watch?v=GQn46bSZE1g) |
@ -1 +1,9 @@ |
||||
# Interfaces |
||||
# Interfaces |
||||
|
||||
In object-oriented programming (OOP), an interface is a contract or a set of methods that a class must implement. It defines a common set of methods that a class must provide, but it does not provide any implementation details. An interface can include both method signatures and constants. |
||||
|
||||
Interfaces are used to define a common behavior for a group of related classes, and to provide a way for objects of different classes to be treated polymorphically. A class that implements an interface must provide an implementation for all of the methods declared in the interface. A class can implement multiple interfaces, but can only inherit from one base class. |
||||
|
||||
Learn more from the following resources: |
||||
|
||||
- [Fundamental concepts: What's an Interface?](https://www.youtube.com/watch?v=o1jBgdhQsGo) |
@ -1 +1,20 @@ |
||||
# Paradigm features |
||||
# Paradigm Features |
||||
|
||||
Object-oriented programming (OOP) is a programming paradigm that is based on the concept of "objects," which are instances of a class. OOP has several key features that distinguish it from other programming paradigms: |
||||
|
||||
1. Encapsulation |
||||
2. Inheritance |
||||
3. Polymorphism |
||||
4. Abstraction |
||||
5. Classes |
||||
6. Objects |
||||
7. Interfaces |
||||
8. Dynamic binding |
||||
9. Message passing |
||||
|
||||
These features provide OOP with the ability to model real-world objects and their interactions, making it well-suited for creating complex and large-scale software systems. |
||||
|
||||
|
||||
Learn more from the following resources: |
||||
|
||||
- [Overview of Object-Oriented Paradigm](https://www.tutorialspoint.com/software_architecture_design/object_oriented_paradigm.htm) |
Loading…
Reference in new issue