Skip to content

nuwanthikaishani/oop-fundamentals-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ OOP Concepts in Java – Example Codes

A collection of beginner-to-advanced examples that demonstrate the core principles of Object-Oriented Programming (OOP) using Java.
This repository is designed to help students, beginners, and interview candidates understand, practice, and master OOP with small, practical code snippets.


🎯 What You’ll Learn

  • βœ… Classes & Objects
  • βœ… Encapsulation
  • βœ… Inheritance
  • βœ… Polymorphism (Overloading & Overriding)
  • βœ… Abstraction (Abstract classes & Interfaces)
  • βœ… Composition, Aggregation & Association
  • βœ… Static & Final usage
  • βœ… Constructor Overloading
  • βœ… Inner Classes
  • βœ… Enums
  • βœ… Interfaces & Multiple Inheritance
  • βœ… Design Patterns (Singleton, Factory, Strategy, Observer)

πŸ“‚ Project Structure

πŸ“‚ Project Structure

oop-concepts-examples/
β”‚
β”œβ”€β”€ encapsulation/       # Getters/Setters, Private fields, Immutable classes
β”œβ”€β”€ inheritance/         # Parent/Child classes, Super/Override
β”œβ”€β”€ polymorphism/        # Overloading, Overriding, Interfaces
β”œβ”€β”€ abstraction/         # Abstract classes & methods, Interfaces
β”œβ”€β”€ composition/         # HAS-A relationships (Car β†’ Engine)
β”œβ”€β”€ association/         # Teacher–Student, Department–Professors
β”œβ”€β”€ static-final/        # Static methods, Constants
β”œβ”€β”€ constructors/        # Constructor overloading examples
β”œβ”€β”€ inner-classes/       # Static & Non-static inner classes
β”œβ”€β”€ enums/               # Day, OrderStatus enums
β”œβ”€β”€ interfaces/          # Multiple inheritance with interfaces
└── design-patterns/     # Singleton, Factory, Strategy, Observer



---

## πŸš€ Getting Started
### 1. Clone the repository
```bash
git clone https://github.com/your-username/oop-concepts-examples.git
cd oop-concepts-examples

About

Code snippets and mini-projects to understand and practice OOP principles in Java.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages