Skip to content

khalaf-droid/oop-java-practice

Repository files navigation

Java OOP Practice Projects

This repository contains a collection of Java practice projects that demonstrate various core concepts of Object-Oriented Programming (OOP).
Each project was created during my academic learning using the NetBeans IDE, applying OOP theory in hands-on coding.


🔖 Table of Contents

  1. Even or Odd Checker – Simple conditionals with encapsulated logic
  2. Student Scores Analyzer – Array processing with statistics
  3. Array Methods Demo – Returning and passing arrays
  4. Quadratic & Rectangle – Constructors, methods, and modular classes
  5. Inheritance with Cylinder & Circle – Inheritance, overriding, and volume calculations
  6. Shapes with Inheritance & Interfaces – Full OOP structure using interfaces and hierarchies
  7. Bank Account & Person Validation – User input + validation logic + account handling
  8. Exception Handling Demo – Custom exception throws and try-catch-finally

🧠 Key OOP Concepts Used

  • Encapsulation (private fields, getters/setters)
  • Inheritance (classes like cylinder extends circle1)
  • Polymorphism (interfaces: shape2, overridden methods)
  • Abstraction (using interfaces and class structures)
  • Constructor Overloading & Method Overriding
  • Exception Handling (try-catch-finally, custom errors)

🗂️ Project Highlights

1. Even or Odd Checker

  • Input from user → determines even or odd
  • Simple method call + scanner
  • Project folder: even-odd-checker-java

2. Student Scores Analyzer

  • Reads 10 scores, calculates max, min, and average
  • Uses int[] array and basic loop logic
  • Project folder: student-scores-analyzer

3. Array Methods Demo

  • Demonstrates passing and returning arrays
  • Uses int[] and double[] arrays
  • Project folder: array-methods-demo

4. Quadratic & Rectangle

  • Class qudratic calculates roots
  • Class rectangle with area and perimeter
  • Project folder: oop-quadratic-and-rectangle-demo

5. Inheritance: Cylinder & Circle

  • Class cylinder inherits from circle1
  • Method overriding and volume calculation
  • Project folder: inheritance-cylinder-circle-demo

6. Shapes – Inheritance & Interfaces

  • Uses interface shape2
  • Classes like rectangle, square, circle use inheritance and override
  • Project folder: oop-shapes-inheritance-interface

7. Bank Account & Person Validation

  • Class bankacount for deposit/withdraw
  • Class person for validating phone/email/age/name
  • Class BirthDate for date verification
  • Project folder: bank-account-and-person-data-validation

8. Exception Handling Demo

  • Method getAverage() throws exceptions for invalid inputs
  • Try-catch blocks for built-in Java exceptions
  • Project folder: java-exception-handling-demo

🛠️ Tech Stack

  • Java SE
  • NetBeans IDE
  • Console I/O
  • OOP Principles

Created with passion and persistence during my journey of mastering OOP in Java 💻✨

About

Java OOP practice projects using NetBeans & Maven

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published