Posts

OOPC - Inheritance (class – class)

Image
In everyday speech, inheritance means receiving assets, property, or characteristics from someone else, typically from a family member (such as a parent). The inheritor (such as a child) can use these as they are or modify them as needed. For example, imagine a child inherits a car from a parent. The child can use the car as it was inherited or modify its features as needed. However, once the car has been modified, it is no longer possible to revert to the exact original state of the car. In programming, when we modify inherited features and behaviors, the original structure remains unchanged. We can always access the original version of the inherited class without affecting its original state. This concept is analogous to inheritance in Object-Oriented Programming (OOP). In Java, inheritance can occur in several scenarios: class – class (extends) class – abstract class (extends) class – interface (implements) abstract class – interface (implements) interface – interface (extends) more...

OOP

Image
OOP Object Oriented Programming is not a completely new concept since it has been around since like 1960s. the earliest implementation of the concept was using Simula programming language at around 1967. With the time, OOP became an essential part of programming since it gives lots of advantages compared to the previously available concepts like Procedural Programming and Structured Programming. OOP provides ways to simulation lots of real-world situations like relationships, entities, inheritance, so.. its quite interesting to understand how this works and how can we get out hands on this. OOPC One of the key thing we need to understand is OOPC (Object Oriented Programming Concepts). These concepts provides ways to interact with components in the OOP. These concepts includes: Inheritance Polymorphism Encapsulation Abstraction Overloading Overriding From next article, let's look into each one of these concepts with Java Programing Language examples.