Skip to content

Commit 3b17a47

Browse files
Merge pull request #1 from nuwanthikaishani/nuwanthikaishani-patch-1
Update README.md
2 parents c6856ae + 6be653b commit 3b17a47

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
Code snippets and mini-projects to understand and practice OOP principles in Java.
1+
# 📘 OOP Concepts in Java – Example Codes
2+
3+
A collection of **beginner-to-advanced examples** that demonstrate the core principles of **Object-Oriented Programming (OOP)** using Java.
4+
This repository is designed to help students, beginners, and interview candidates **understand, practice, and master OOP** with small, practical code snippets.
5+
6+
---
7+
8+
## 🎯 What You’ll Learn
9+
- ✅ Classes & Objects
10+
- ✅ Encapsulation
11+
- ✅ Inheritance
12+
- ✅ Polymorphism (Overloading & Overriding)
13+
- ✅ Abstraction (Abstract classes & Interfaces)
14+
- ✅ Composition, Aggregation & Association
15+
- ✅ Static & Final usage
16+
- ✅ Constructor Overloading
17+
- ✅ Inner Classes
18+
- ✅ Enums
19+
- ✅ Interfaces & Multiple Inheritance
20+
- ✅ Design Patterns (Singleton, Factory, Strategy, Observer)
21+
22+
---
23+
## 📂 Project Structure
24+
25+
26+
```text
27+
oop-concepts-examples/
28+
29+
├── encapsulation/ # Getters/Setters, Private fields, Immutable classes
30+
├── inheritance/ # Parent/Child classes, Super/Override
31+
├── polymorphism/ # Overloading, Overriding, Interfaces
32+
├── abstraction/ # Abstract classes & methods, Interfaces
33+
├── composition/ # HAS-A relationships (Car → Engine)
34+
├── association/ # Teacher–Student, Department–Professors
35+
├── static-final/ # Static methods, Constants
36+
├── constructors/ # Constructor overloading examples
37+
├── inner-classes/ # Static & Non-static inner classes
38+
├── enums/ # Day, OrderStatus enums
39+
├── interfaces/ # Multiple inheritance with interfaces
40+
└── design-patterns/ # Singleton, Factory, Strategy, Observer
41+
42+
43+
```
44+
45+
## 🚀 Getting Started
46+
### 1. Clone the repository
47+
```bash
48+
git clone https://github.com/nuwanthikaishani/oop-fundamentals-java
49+
cd oop-fundamentals-java
50+
```
51+
52+
### 2. Compile and Run
53+
```bash
54+
cd src/encapsulation
55+
javac EncapsulationDemo.java
56+
java EncapsulationDemo
57+
```
58+
59+
## 🎓 Who Is This For?
60+
- ✅ Students learning Java OOP for the first time
61+
- ✅ Developers preparing for coding interviews
62+
- ✅ Anyone who wants a quick refresher on OOP principles
63+
64+
65+
66+

0 commit comments

Comments
 (0)