Skip to content

Latest commit

 

History

History
48 lines (40 loc) · 2.1 KB

README.md

File metadata and controls

48 lines (40 loc) · 2.1 KB

🎓 Mastering Java OOP: Advanced Techniques

📚 What is Covered?

This module dives into the advanced Object-Oriented Programming techniques in Java, focusing on Composition, Encapsulation, and Polymorphism.

  • Composition: Modeling "has-a" relationships by assembling objects from other objects, and exposing clean delegation methods.
  • Encapsulation: Hiding data and simplifying interfaces to secure fields and prevent invalid state.
  • Polymorphism: Runtime method dispatch, factory methods, class casting, var, and instanceof with pattern matching.
  • Challenges: Hands-on practice combining composition, encapsulation, and polymorphism in real-world-style exercises.

In addition, Packages is covered as an extra topic:

  • Packages: Organizing code into modular structures and controlling access through imports and package declarations.

🏗️ Project Structure

The project is organized into several subfolders, each focusing on a specific topic:

  • ComputerFactory/:
    • ComputerFactory: Composition in action — building a PC from a case, monitor, and motherboard, and understanding has-a vs. is-a.
  • Encapsulation/:
    • Encapsulation: Data hiding, validation in constructors, and simplifying public interfaces from a basic to an enhanced Player class.
  • Packages/:
    • Packages: Package declarations and import statements to structure and share code across namespaces.
  • Polymorphism/:
    • Polymorphism: Movie subclasses, factory methods, runtime type inspection with instanceof and pattern matching, casting, and var usage.
  • challenges/:
    • BedroomComposition: Composition practice modeling a bedroom from walls, ceiling, bed, and lamp.
    • SmartKitchen: Modeling IoT kitchen appliances with composition and delegated work.
    • Printer: Encapsulation challenge with toner levels and duplex printing.
    • CarTypes: Polymorphism challenge building gas, electric, and hybrid car subclasses.
    • BillsBurgerChallenge: OOP Master Challenge crafting a burger restaurant app with meal orders, deluxe burgers, and pricing.