Object-oriented programming (OOP) is a programming paradigm in which programs are designed using ๐ฐ๐น๐ฎ๐๐๐ฒ๐ ๐ฎ๐ป๐ฑ ๐ผ๐ฏ๐ท๐ฒ๐ฐ๐๐.
A class is a template or blueprint from which objects are made from. Classes define the properties and methods that an object can have, and objects are unique instances of a class.
๐ข๐ฏ๐ท๐ฒ๐ฐ๐-๐ผ๐ฟ๐ถ๐ฒ๐ป๐๐ฒ๐ฑ ๐ฝ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด ๐ต๐ฎ๐ ๐ฐ ๐บ๐ฎ๐ถ๐ป ๐ฝ๐ฟ๐ถ๐ป๐ฐ๐ถ๐ฝ๐น๐ฒ๐; ๐ฒ๐ป๐ฐ๐ฎ๐ฝ๐๐๐น๐ฎ๐๐ถ๐ผ๐ป, ๐ถ๐ป๐ต๐ฒ๐ฟ๐ถ๐๐ฎ๐ป๐ฐ๐ฒ, ๐ฎ๐ฏ๐๐๐ฟ๐ฎ๐ฐ๐๐ถ๐ผ๐ป, and ๐ฝ๐ผ๐น๐๐บ๐ผ๐ฟ๐ฝ๐ต๐ถ๐๐บ.
๐๐ป๐ฐ๐ฎ๐ฝ๐๐๐น๐ฎ๐๐ถ๐ผ๐ป hides internal details but exposes data & methods via a public interface, preventing unintentional changes. E.g. โ a player can view a pet's age but can't accidentally change it. But they can run methods avail on the public interface like changing a pet's name.
๐๐ป๐ต๐ฒ๐ฟ๐ถ๐๐ฎ๐ป๐ฐ๐ฒ allows classes to inherit properties and methods from other classes, making code reusable and organized. E.g. โ A "SuperPet" class that extends from "Pet "and would inherit "age", "name", "eat", and "speak"; while defining new behaviors like "fly"
๐ฃ๐ผ๐น๐๐บ๐ผ๐ฟ๐ฝ๐ต๐ถ๐๐บ is a principle that enables objects to change their form by extending or overriding existing methods. E.g. A "Dog" & "Cat" class that extended from the "Pet", shouldn't share the same "speak" method. You'd override it to have its own logic like "woof" or "meow"
๐๐ฏ๐๐๐ฟ๐ฎ๐ฐ๐๐ถ๐ผ๐ป reduces complexity by only surfacing the information needed for a given context or use case. E.g. A โPlayerโ class doesnโt need to know how the โeatโ method works in the โPetโ class, it just needs to know how to interact with it โ i.e. its input & output.