Welcome to the repository for Week 2 of our Java learning journey. This week dives deeper into the core principles of Object-Oriented Programming (OOP) using Java.
- Overview
- Day 1: Object Oriented Programming Fundamentals
- Day 2: Java Constructors, Instance vs. Class Variables, Access Modifiers Concepts
- Day 3: This, Static, Final Keywords and Instanceof Operator
- Day 4: Object Modeling and Class Diagram
- Day 5: Inheritance
- Day 6: Encapsulation, Interface, Abstract Classes, and Polymorphism
- Prerequisites
- How to Use This Repository
In Week 2, we focused on mastering Object-Oriented Programming concepts, which form the foundation of Java application development. You will learn how to design robust, maintainable, and reusable code using OOP principles.
- Understanding classes and objects
- Defining instance variables and methods
- Object creation process and memory allocation
- Basic OOP principles introduction
- Creating and overloading constructors
- Differentiating instance and class (static) variables
- Access modifiers: public, private, protected, default
- Understanding scope and encapsulation basics
- Using
thiskeyword to resolve variable shadowing and call constructors - Static variables and methods at class level
- Final keyword usage for constants and method restrictions
instanceofoperator for type checking
- Introduction to object modeling concepts
- Designing class diagrams for OOP systems
- Relationships between classes (association, aggregation, composition)
- Visualizing object interactions
- Concept of inheritance and code reuse
- Using the
extendskeyword for single inheritance - Accessing superclass members using
superkeyword - Method overriding basics
- Encapsulation through private variables and public getters/setters
- Abstract classes and abstract methods
- Defining and implementing interfaces
- Polymorphism: method overloading and overriding
- Runtime polymorphism and dynamic method dispatch
- Java Development Kit (JDK) installed
- Familiarity with Java basics (Week 1)
- An IDE like IntelliJ IDEA, VS Code, or Eclipse
The repository is organized by daily topics. Each folder contains Java files demonstrating the key concepts learned that day. You can:
- Explore the examples
- Run and debug the code
- Modify the code to experiment and reinforce your understanding