My first Java Blog Part I For me, OOP is a method of structuring software that models it around objects rather than actions. How? Let's first understand the basic foundations of it! Object: Think of an object as something you use daily, like a smartphone. In programming, an object combines data (like battery level, and apps installed) and actions (such as making calls or sending messages). This approach keeps the object's data safe and lets it perform its tasks effectively. Class: A class is like a recipe. It tells the computer what an object should have and what it can do. For example, a class for a bicycle would include instructions for creating bicycles, specifying features like speed and how to change gears. Inheritance: Inheritance is a way to create a new class using an existing class as a foundation. It's like how you might inherit your eye colour or height from your parents. This means you can create a specialized version of a class (like a mountain bike class from...
Posts
Showing posts from April, 2024