Object-Oriented Programming OOP Fundamentals English 2026
Almost all modern programming languages already support OOP, and future programming languages will also be based on it. Anyone working in software development is likely already working with object-oriented programming.
Our Amazon book recommendation on the topic of OOP: Object-Oriented Programming: The Comprehensive Manual.
Is such a book directly recommended? No, if you don’t yet know an OOP language, I recommend a regular book or a course on the respective programming language. Because the fundamentals are explained well there and you can handle OOP automatically. The mentioned book could be too challenging if you don’t yet have any programming experience.
Here are comprehensive programming books: JavaScript: The Comprehensive Manual. Learn and Understand JavaScript. Including Object-Oriented and Functional Programming
We would like to present the most important principles here and give some examples.

What is Object-Oriented Programming OOP?
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of “objects”, which encapsulate data and methods for processing it in a single unit. In OOP, programs are conceived as collections of objects that interact with each other to accomplish complex tasks.
The fundamental principles of OOP are:
1. Encapsulation 2. Inheritance 3. Polymorphism 4. Abstraction
Encapsulation - Object-Oriented Programming
Each object in OOP contains data (in the form of attributes or properties) and the methods (functions) that process this data. Encapsulation hides the internal details of an object and provides a public interface for interaction with the object.
Encapsulation in object-oriented programming means that the internal details of an object remain hidden and are only accessible through defined interfaces. Here are examples of encapsulation in JavaScript, PHP, and Java:
Access Modifiers as a Tool of Object-Oriented Programming A brief introduction: In object-oriented programming languages like Java and C#, access modifiers specify how access to classes, methods, constructors, and properties is controlled. Here are the common access modifiers briefly explained:
public: A member declared as public is accessible from anywhere, inside and outside the class or package in which it is defined. private: A private member is only accessible within the class in which it is defined. It is not accessible from outside or from derived classes (subclasses). protected: A protected member is accessible within its class and from derived classes, regardless of whether they are in the same package or not. default (package-private in Java): If no access modifier is specified, the member has package access in Java, which means it is accessible from any class in the same package, but not from classes outside that package. internal (in C#): An internal member is accessible within the entire assembly in which it is defined, but not from outside the assembly.
These access modifiers help implement the principles of encapsulation and information hiding in object-oriented programming by controlling the visibility and access to different parts of the code.
Encapsulation Example using JavaScript:
In JavaScript, encapsulation can be achieved using functions and closures,
since it does not offer explicit means like ‘private’ or ‘public’ keywords.

Encapsulation Example using PHP:
PHP OOP Encapsulation PHP supports encapsulation through access modifiers like private, protected, and public.

Encapsulation Example using Java:
Java OOP Encapsulation

In all three examples, the data (name and age) is encapsulated in the Person class and is only accessible through public methods (getName() and getAge()). Direct access to the internal variables from outside the class is not possible, which demonstrates encapsulation.
Inheritance - Object-Oriented Programming
Inheritance allows new objects (derived classes) to inherit properties and behavior from existing objects (base classes). This promotes code reusability and facilitates the creation and maintenance of complex systems.
Inheritance in JavaScript is handled somewhat differently than in classical object-oriented programming languages like Java or C++. JavaScript uses prototypes for inheritance instead of classes and class inheritance (although modern JavaScript versions provide class syntax that is based on prototypes under the hood).
In JavaScript, every object inherits properties and methods from a prototype object. Here is a simple example showing how inheritance works in JavaScript:

In this example, Employee is created so that it inherits from Person. This is achieved by:
Calling the Person constructor function with Person.call(this, name) within the Employee constructor to inherit properties from Person. Setting Employee.prototype to an object created from Person.prototype, which allows Employee to inherit methods from Person (Object.create(Person.prototype)). Overriding the greet method for Employee to define specific behavior for Employee instances.
Polymorphism - Object-Oriented Programming
Polymorphism allows objects to respond to the same message or method in different ways, based on their type or class. This enables flexible code structure where the same code can work with different object types.
Polymorphism, a central concept of object-oriented programming (OOP), refers to the ability of objects of different classes to respond to the same message or method in different ways. The term “polymorphism” comes from Greek and means “many forms”. In OOP, polymorphism enables an interface to have multiple implementations, resulting in more flexible and reusable code.
There are mainly two types of polymorphism:
-
Method Overriding Here, classes derived from a base class can “override” a method of the base class to provide a specific implementation. For example, a base class Animal can have a speak() method, and the derived classes Dog and Cat can override this method to output “Barking” and “Meowing” respectively.
-
Method Overloading Here, the same class can have multiple methods with the same name but different parameters. The correct method is selected at runtime based on the passed arguments.
Polymorphism enables developers to write code that works with objects of different classes, as long as these classes share a common interface or base class. This results in a more flexible and extensible codebase, since new classes can be added without modifying existing code.
In JavaScript, polymorphism is usually realized through prototypes and constructor functions. Here is an example showing how polymorphism can work in JavaScript:

In this example, Animal is a base constructor function with a speak method. Both Dog and Cat are derived constructor functions that inherit from Animal. Each derived class calls the Animal constructor with a different sound. This effectively “overrides” how the speak method works for their respective instances, even though they use the same method in the prototype. This is an example of polymorphism in action: Different objects can execute the same method in different ways.
OOP Abstraction - Object-Oriented Programming
Abstraction refers to the ability to simplify complex aspects of reality by modeling only the relevant properties and behaviors. This makes understanding and handling complex systems easier.
Abstraction in programming, including in JavaScript, refers to the practice of simplifying complex reality by presenting only relevant data and actions while hiding unnecessary details. In JavaScript, this can be achieved through the use of constructor functions, classes (in ES6 and later), or modules to define an interface that summarizes the functionality of a component or object.
Here is a simple example of abstraction in JavaScript using a class:

In this example, Car is an abstract representation of a car. It hides the complexity of what exactly happens when a car starts or drives, and instead provides simple start and drive methods. Users of the Car class don’t need to deal with the details of the engine, transmission, or other internal mechanisms. They interact with the Car object only through the defined methods.
This type of abstraction allows the code to remain clean, understandable, and maintainable by hiding details and presenting only what is relevant to the user of the class.
Which well-known programming languages do not work with OOP?
There are several well-known programming languages that are not primarily oriented towards Object-Oriented Programming (OOP), although some of them can support OOP elements. Here are some examples: C C is a procedural programming language used for systems and application programming. It does not support OOP concepts like classes and objects. Fortran An older language mainly used in scientific and engineering applications. It is procedural and does not support OOP. COBOL A language mainly used in business applications. It is procedural and does not support OOP in its original design, although later versions introduced some object-oriented features. Bash/Shell-Scripting languages These languages are used for writing scripts in Unix and Linux environments. They are procedural and generally do not support object-oriented concepts. Haskell A functional programming language that focuses on functions instead of objects. Functional programming languages like Haskell use different paradigms than OOP. Erlang Another functional programming language known for distributed systems and real-time applications. Prolog A logic-based programming language mainly used in Artificial Intelligence and computational linguistics. SQL (Structured Query Language) A language for managing and querying data in relational database systems. SQL is a declarative language and does not follow OOP principles.
These languages follow other paradigms such as procedural, functional, declarative, or logic-based paradigms. Each paradigm has its own strengths and areas of application, and the choice of language often depends on the specific requirements of the project.
Which well-known languages support OOP?
Many modern and widely used programming languages support Object-Oriented Programming (OOP).
Java One of the most well-known OOP languages, recognized for its platform independence and extensive standard library.
C++ An extension of the C programming language that adds OOP elements and is used for systems and application programming.
Python A versatile high-level language that supports OOP and is known for its simple syntax and readability.
C# (C-Sharp) Developed by Microsoft, an OOP language frequently used for developing Windows applications and games.
Ruby A dynamic programming language known for its elegance and productive syntax. Ruby follows the principle “Everything is an object”.
PHP Originally a simple scripting language, it now fully supports OOP and is frequently used for web development.
Swift Developed by Apple, Swift is an OOP language used for developing iOS and macOS applications.
Kotlin A relatively new language developed for the Java Virtual Machine (JVM) and offers complete OOP support. It is increasingly used for Android development. Objective-C Before the introduction of Swift, this was the primary programming language for developing iOS and macOS applications. Smalltalk One of the first pure OOP languages that shaped many of the concepts used in later OOP languages.
These languages offer comprehensive support for OOP concepts such as classes, objects, inheritance, polymorphism, and encapsulation, and are used in a wide variety of application areas, from systems programming to mobile and web development to scientific applications.
Which programming language should a beginner start with?
This question is difficult; I started with Basic, then Turbo-Pascal, and at university JAVA was learned as an OOP language.
I personally recommend Python or JavaScript, because you can immediately create your own projects here.
The choice of a programming language for beginners depends on various factors, including personal interests, the type of projects you want to develop, and the learning resources available. Here are some common programming languages often recommended for beginners:
Python: Because of its clear and easily readable syntax, Python is ideal for beginners. It is used in various fields, from web development to data analysis to machine learning.
JavaScript: If you are interested in web development, JavaScript is essential. It is used on the client-side in virtually all web browsers and increasingly on the server-side via Node.js.
Java: Java is a versatile language widely used in the enterprise world. It has a somewhat stricter syntax than Python, which can be good for understanding basic programming principles.
C#: If you are interested in game development, particularly with the Unity engine, C# is a good choice. It is also used for Windows applications.
Ruby: Known for its elegant syntax, Ruby is a good language for beginners interested in web development, particularly with the Ruby on Rails framework.
Kotlin: If you are interested in Android app development, Kotlin is a modern, user-friendly language recommended by Google as the preferred language for Android.
Swift: For iOS app development, Swift is the first choice. It has been developed by Apple and is well-accessible for beginners.
It is also important to remember that learning the fundamentals of programming – such as loops, conditionals, variables, functions, and data structures – is more important than the specific language you choose. These concepts are universal across most programming languages.
Recommended Literature: Object-Oriented Programming
Keine Bücher für Kategorie "objektorientierte-programmierung" gefunden.