In this level, you learned what primitive types Java has and how they are expanded and narrowed. We talked about objects and classes. What's more, we began to study what makes Java Java — the principles of object-oriented programming. Be patient a little longer: before you proceed to the next level, we recommend that you work through this lesson.

Principles of OOP

You already know how everything is organized in Java: you declare classes and create objects based on classes, classes have methods, etc. But why is it all like this and not otherwise? Why is the language structured so that programs consist of classes and objects, and not something else? Why was the concept of an "object" invented and put at the forefront? Are all languages designed this way? If not, what advantages does it give to Java? There are a lot of questions. This lesson will help you tackle them. You will dive deep into the principles of OOP: inheritance, abstraction, encapsulation, and polymorphism.


A lecture snippet with a mentor as part of the Codegym University course. Sign up for the full course.