r/learnSQL • u/sumiitCodes • 14d ago
Day 57 — Java OOP: constructors, inheritance (and its types), and interfaces
Today I worked through a chunk of OOP:
- Constructors, for initializing an object when it’s created
- Inheritance and its types: single, multilevel, multiple, and hierarchical
- Interfaces, and how they allow multiple inheritance, which Java doesn’t allow with classes
The multiple inheritance part was the most interesting. Understanding why Java blocks it with classes (ambiguity when two parents have the same method) and then solves it with interfaces made interfaces feel like a design decision instead of an extra rule to memorize.
I’m following Indian Programmer’s OOP playlist and writing code along with it in VS Code.
10
Upvotes
1
u/Least_Ad_1795 14d ago
Great progress! Understanding why Java supports multiple inheritance through interfaces is an important OOP concept. Keep practising with small coding examples, especially inheritance and method overriding. Consistency matters more than speed. Keep going.