Skip to content

The Vehicle Management System is a Java project that demonstrates OOP concepts like encapsulation, inheritance, polymorphism, and method overriding. It models a base `Vehicle` class with `Car` and `Bike` subclasses to show real-world object relationships using upcasting and downcasting.

Notifications You must be signed in to change notification settings

stanlykanukula/Java_VMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Vehicle Management System

  • A beginner-friendly Java OOP project that models a simple Vehicle Management System.
  • It focuses on demonstrating Encapsulation, Inheritance, Method Overriding and Upcasting/Downcasting in real-world scenarios using Car and Bike classes.

🎯 Project Goal

To create a mini Java application that manages different vehicle types and showcases:

  • Encapsulation through private fields & getters/setters
  • Inheritance with a Vehicle base class and specialized Car & Bike classes
  • Method overriding for vehicle-specific details
  • Upcasting and safe downcasting

πŸ“Œ Project Requirements

1️⃣ Encapsulation

  • Vehicle class has private fields:
    • brand (String)
    • speed (int)
  • Public getter & setter methods control access.

2️⃣ Inheritance

  • Subclasses:
    • Car β†’ extra field: fuelType (String)
    • Bike β†’ extra field: engineCC (int)

3️⃣ Method Overriding

  • Each subclass overrides showDetails() to print vehicle-specific data.

4️⃣ Upcasting and Downcasting

  • Upcasting: Treat Car or Bike objects as Vehicle references.
  • Downcasting: Access subclass-specific fields safely after type checking.

πŸ“‚ Project Structure

β”œβ”€β”€ src/
β”‚ └── vms/
β”‚ β”œβ”€β”€ Vehicle.java
β”‚ β”œβ”€β”€ Car.java
β”‚ β”œβ”€β”€ Bike.java
β”‚ β”œβ”€β”€ Main.java
β”‚ └── module-info.java
β”œβ”€β”€ bin/ # Compiled .class files
β”œβ”€β”€ .classpath
β”œβ”€β”€ .project
β”œβ”€β”€ README.md
└── .settings/

Code Editor

  • Eclipse

Sample Output

The car fuel type is petrol
The engine cc of bike  is 250
Enfield
100

About

The Vehicle Management System is a Java project that demonstrates OOP concepts like encapsulation, inheritance, polymorphism, and method overriding. It models a base `Vehicle` class with `Car` and `Bike` subclasses to show real-world object relationships using upcasting and downcasting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages