17/100 🧠 “building focus, strengthening logical thinking, and staying consistent with problem solving.” Today I explored object composition and dependency injection in Java by modeling a simple Computer system with Memory and Processor classes. Instead of creating objects inside the class directly, I passed them through the constructor, which makes the design more flexible and testable. This helped me understand how classes can collaborate while still keeping responsibilities separate. The Computer doesn’t “become” Memory or Processor — it simply uses them. That separation improves modularity and makes the code easier to maintain. Learning how real-world systems are structured through clean OOP design. #Java #OOP #ObjectOrientedProgramming #DependencyInjection #CleanCode #LearningInPublic #CodingJourney #ConsistencyChallenge
Java OOP: Object Composition and Dependency Injection
More Relevant Posts
-
Today I built a small but meaningful OOP practice project: a simple Notification System using Inheritance and Polymorphism. I created three different notification types: - Email - SMS - Push All of them extend a common base class (Notification) and override the send() method with their own behavior. This exercise helped me better understand how polymorphism allows different objects to share a unified interface while keeping their unique implementations. If you have suggestions for improving the structure or extending the project, I’d love to hear your thoughts. 🔗 GitHub Repository: https://lnkd.in/eTcEGqbY #Java #OOP #ObjectOrientedProgramming #Polymorphism #Inheritance #JavaDeveloper #CodingPractice #SoftwareDevelopment #LearningInPublic #WomenInTech #ProgrammerLife #CleanCode #TechJourney
To view or add a comment, sign in
-
-
Day 43/100 | Building Consistency 🗽 Showing up every day. Learning, growing, and improving. #Abstraction vs #Encapsulation 📱 What you see on the screen → Abstraction You interact with icons, buttons, and features. You know what the system does, not how it works internally. 👉 Abstraction focuses on exposing only essential functionality 👉 Implemented using interfaces and abstract classes 🧠 What runs behind the screen → Encapsulation Business logic, data, and internal states stay hidden and protected. 👉 Encapsulation focuses on data security and control 👉 Implemented using private variables + public methods 🔑 Key takeaway Abstraction = What to show Encapsulation = How to protect Or simply: Abstraction hides complexity. Encapsulation hides data. Learning OOP isn’t about memorizing definitions — it’s about thinking in layers and designing better systems. Day 43 of showing up and building strong Java fundamentals. 💪 #Java #OOP #Abstraction #Encapsulation #BackendDevelopment #Consistency #LearningInPublic
To view or add a comment, sign in
-
-
Today I practiced advanced Star Pattern Programs in Java using nested loops. In this part, I implemented: 1)Left Triangle Pattern 2)Hollow Pyramid 3)Hollow Diamond These patterns helped me strengthen my understanding of: 🔹 Nested loops 🔹 Logical thinking 🔹 Pattern visualization 🔹 Conditional statements Practicing pattern problems improves problem-solving skills and builds a strong foundation for Data Structures & Algorithms. Consistency is the key to mastering programming
To view or add a comment, sign in
-
𝐓𝐮𝐫𝐧𝐢𝐧𝐠 𝐌𝐚𝐭𝐡 𝐃𝐞𝐟𝐢𝐧𝐢𝐭𝐢𝐨𝐧𝐬 𝐢𝐧𝐭𝐨 𝐉𝐚𝐯𝐚 𝐋𝐨𝐠𝐢𝐜. Implemented an algorithm to identify Armstrong Numbers in Java. The definition is simple: 𝐀 𝐧𝐮𝐦𝐛𝐞𝐫 𝐢𝐬 𝐚𝐧 𝐀𝐫𝐦𝐬𝐭𝐫𝐨𝐧𝐠 𝐧𝐮𝐦𝐛𝐞𝐫 𝐢𝐟 𝐭𝐡𝐞 𝐬𝐮𝐦 𝐨𝐟 𝐢𝐭𝐬 𝐝𝐢𝐠𝐢𝐭𝐬 𝐫𝐚𝐢𝐬𝐞𝐝 𝐭𝐨 𝐭𝐡𝐞 𝐩𝐨𝐰𝐞𝐫 𝐨𝐟 𝐭𝐡𝐞 𝐧𝐮𝐦𝐛𝐞𝐫 𝐨𝐟 𝐝𝐢𝐠𝐢𝐭𝐬 𝐞𝐪𝐮𝐚𝐥𝐬 𝐭𝐡𝐞 𝐧𝐮𝐦𝐛𝐞𝐫 𝐢𝐭𝐬𝐞𝐥𝐟(e.g., 153 = 1³ + 5³ + 3³). 𝐓𝐡𝐞 𝐈𝐦𝐩𝐥𝐞𝐦𝐞𝐧𝐭𝐚𝐭𝐢𝐨𝐧 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲: [1.] 𝐃𝐲𝐧𝐚𝐦𝐢𝐜 𝐃𝐢𝐠𝐢𝐭 𝐂𝐨𝐮𝐧𝐭𝐢𝐧𝐠: Used 𝐒𝐭𝐫𝐢𝐧𝐠.𝐯𝐚𝐥𝐮𝐞𝐎𝐟(𝐧).𝐥𝐞𝐧𝐠𝐭𝐡() to handle numbers of any size, rather than hardcoding the power to 3. [2.]𝐃𝐢𝐠𝐢𝐭 𝐄𝐱𝐭𝐫𝐚𝐜𝐭𝐢𝐨𝐧: Used Modulo % 10 to strip digits one by one. [3.] 𝐏𝐨𝐰𝐞𝐫 𝐂𝐚𝐥𝐜𝐮𝐥𝐚𝐭𝐢𝐨𝐧: Leveraged 𝐌𝐚𝐭𝐡.𝐩𝐨𝐰() for the exponential math. Ran the code to find all Armstrong numbers up to 1,000,000. It’s a great exercise for practicing loops and type casting. #Java #Algorithms #NumberTheory #Coding #BackendDevelopment #WeMakeDevs #CleanCode #SoftwareEngineering #DeveloperJourney #IntelliJ
To view or add a comment, sign in
-
Writing methods is powerful. But real Java begins when you understand classes. A class is not just a file. It’s a blueprint. When you write: public class Car { String model; int speed; void accelerate() { speed++; } } You’re defining: • What something has (state / fields) • What something does (behavior / methods) That’s object-oriented thinking. Instead of writing loose functions, you start modeling real-world entities. This shift matters. Procedural thinking asks: “How do I solve this step by step?” Object-oriented thinking asks: “What is responsible for this behavior?” That small shift improves: • Code organization • Scalability • Maintainability Today was about: • Understanding what a class really represents • The difference between state and behavior • Thinking in objects instead of instructions Structure is not restriction. It’s preparation for complexity. #Java #OOP #Classes #SoftwareDesign #Programming #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day 16 – Applying Object-Oriented Programming in Java Today, I focused on strengthening my understanding of core OOP concepts by implementing a real-world example using a Car class in Java. Instead of just learning theory, I applied: ✔ Instance Variables ✔ Instance Methods ✔ Object Creation ✔ Method Invocation ✔ Basic Validation Logic 🛠 What I Implemented: Designed a Car class with attributes like wheels, color, fuel level, and max speed Created methods like drive(), addFuel(), and getCurrentFuelLevel() Added logical checks to prevent invalid operations (e.g., driving without fuel) Created and tested objects inside the main() method 💡 Key Learning: Understanding OOP is not just about syntax — it’s about modeling real-world entities into structured, reusable, and maintainable code. Today helped me move from writing simple programs to thinking in terms of objects and behavior — a critical step toward backend development and scalable system design. #100DaysOfCode #Java #OOP #ObjectOrientedProgramming #SoftwareDevelopment #JavaDeveloper #BackendDeveloper #ProgrammingFundamentals #CodingJourney #TechGrowth #ComputerScience #DeveloperMindset #LearningDaily
To view or add a comment, sign in
-
-
💻 Day 10 – Understanding Abstraction in Java Today I explored one of the core pillars of Object-Oriented Programming: Abstraction. Abstraction is about hiding implementation details and showing only the essential features of an object. What I learned today: • How to create an abstract class • Difference between abstract methods and normal methods • How child classes implement abstract methods • How interfaces work in Java • Real-world understanding of “what to do” vs “how to do” Key takeaway: Encapsulation hides data Abstraction hides implementation Using abstract classes and interfaces makes code: ✔ More scalable ✔ More structured ✔ Easier to maintain Every day I’m understanding how OOP concepts make real-world applications more organized and powerful 💡 #Java #OOP #Abstraction #LearningInPublic #ComputerScience #Day10 #CodingJourney
To view or add a comment, sign in
-
-
Another key idea in object oriented programming is abstraction. Abstraction focuses on exposing only the essential behaviour of an object while hiding the internal implementation details. In Java, one way to achieve abstraction is through abstract classes. Things that became clear : • an abstract class cannot be instantiated directly • abstract classes can contain both abstract methods and normal methods • abstract methods declare behaviour but do not provide implementation • child classes must provide implementation for the abstract methods • this allows a common structure while letting subclasses define specific behaviour A simple example helps illustrate the idea : abstract class Bird { abstract void fly(); } class Sparrow extends Bird { void fly() { System.out.println("Sparrow flying"); } } Here the Bird class defines the idea of flying, but the actual behaviour is implemented by the specific type of bird. This approach helps separate what an object does from how it actually performs the task. #java #oop #programming #learning #dsajourney
To view or add a comment, sign in
-
Day 22/100 – Revisiting OOP Concepts in Java ☕💻 Today I went back to the core pillars of Object-Oriented Programming: ✔ Abstraction ✔ Encapsulation ✔ Inheritance ✔ Polymorphism ✔ Association ✔ Aggregation ✔ Composition ✔ Coupling ✔ Cohesion Sometimes we rush into frameworks and advanced topics, but strong fundamentals make everything easier to understand — from backend architecture to scalable system design. Revisiting OOP reminds me that clean structure, low coupling, and high cohesion aren’t just theory… they shape real-world applications. Consistency > Intensity. Still building. 🚀 #100DaysOfCode #Java #OOPS #SoftwareEngineering #CleanCode #Consistency #ComputerScience #LearningJourney
To view or add a comment, sign in
-
-
We started with OOP fundamentals — the building blocks of system design. Now we move into the principles that make real systems scalable: SOLID. Today’s concept: Single Responsibility Principle (SRP) A class should have only one reason to change. In simple terms — one job, done well. When responsibilities are mixed, systems become hard to test, maintain, and scale. When responsibilities are clear, design becomes flexible and predictable. In this carousel, I’ve explained SRP with simple real-world examples and interview insights. Save it for revision if you're preparing for interviews or improving design thinking. What’s one place you’ve seen SRP violated in real projects? #OOP #SoftwareEngineering #SystemDesign #Programming #CleanCode #CodingInterview #DeveloperJourney #TechLearning #BackendDevelopment #DotNet #Java #FullStackDeveloper #Python
To view or add a comment, sign in
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development