This repository contains a collection of projects and assignments completed for the Object-Oriented Programming (OOP) course. The projects demonstrate various OOP principles, design patterns, and Java programming techniques, ranging from basic string manipulation to multi-threaded task execution.
- Assignment 1: Undoable StringBuilder
- Assignment 2: Observer Pattern & Memory Monitoring
- Assignment 3: Concurrency & Thread Pools
- Tech Stack
- How to Run
Location: Assignment-1/
A custom StringBuilder implementation that supports undo operations.
- Key Features:
append,delete,insert,replace,reverse, andundo. - Focus: Basic Java syntax, internal state management (Stack), and unit testing.
Location: Assignment-2/
An implementation of the Observer design pattern to monitor changes in an UndoableStringBuilder.
- Components:
GroupAdmin(Subject): Manages members and notifies them of changes.ConcreteMember(Observer): Receives updates and maintains a local state.JvmUtilities: A utility class for tracking JVM memory usage and object footprints.
- Focus: Design patterns, reference handling, and JVM internals.
Location: Assignment-3/
Location: Assignment-3/Part-A
- Compares performance of line counting in multiple files using:
- Sequential processing.
- Multi-threading (Thread class).
- Thread Pools (ExecutorService).
Location: Assignment-3/Part-B
- A custom
ThreadPoolExecutorthat supports prioritized tasks. - Key Features:
TaskType: Enum for task priorities (Computational, IO, Other).CustomExecutor: Manages a priority queue of tasks.Task: A generic task wrapper implementingCallableandComparable.
- Language: Java (JDK 19+)
- Build Tool: Maven (for some assignments)
- Testing: JUnit 5
- IDE: IntelliJ IDEA / VS Code
- Java Development Kit (JDK) 21 or higher.
- Maven (optional, for dependency management).
Each assignment contains JUnit tests. You can run them using your IDE or Maven.
Example (using Maven):
cd Assignment-2
mvn testExample (using IDE):
- Open the project in IntelliJ IDEA.
- Navigate to the
testfolder in the desired assignment. - Right-click the test class (e.g.,
Tests.java) and select "Run".
Note: This repository is for educational purposes.