A Java-based console application demonstrating Object-Oriented Programming (OOP) principles through a simple yet extensible vehicle management simulation.
This project models real-world vehicle types—such as bikes and electric cars—using abstraction, inheritance, encapsulation, interfaces, and polymorphism.
- Overview
- Features
- UML Class Structure
- File Structure
- Technologies
- How to Run
- Example Code Snippet
- OOP Concepts Displayed
- Future Improvements
- Author
- License
The Vehicle Management System is a Java console application that demonstrates key OOP concepts by managing different vehicle types.
It serves as an excellent educational project or a foundation for beginners learning class hierarchies, abstraction, and interfaces in Java.
- 🚘 Add and manage multiple vehicle types (Bike, ElectricCar, etc.)
- 🔋 Supports both conventional and electric vehicles
- 🧱 Showcases inheritance, abstraction, and polymorphism
- 🧩 Implements interfaces for modular design
- 🧠 Uses abstract classes and method overriding effectively
- 🧹 Simple, modular structure for easy maintenance and extension
+---------------------+
| Vehicle | <-- Abstract Class
+---------------------+
| - brand: String |
| - model: String |
| - price: double |
+---------------------+
| + displayInfo() |
+---------------------+
^
|
----------------------------
| |
+--------------+ +----------------+
| Bike | | ElectricCar |
+--------------+ +----------------+
| - isManual | | - batteryCap |
| | | - range |
+--------------+ +----------------+
| ^
| |
+----------------------+ +-------------------+
| implements Vehicle | | implements |
| | | ElectricVehicle, |
| | | SmartFeatures |
+----------------------+ +-------------------+
| File | Description |
|---|---|
| Vehicle.java | Abstract parent class representing a generic vehicle. Contains shared attributes and behaviors. |
| Bike.java | Subclass representing a manual or motorbike with overridden methods. |
| ElectricVehicle.java | Interface defining electric vehicle behaviors (charging, battery info). |
| ElectricCar.java | Subclass implementing both ElectricVehicle and SmartFeatures. Represents an advanced electric car. |
| SmartFeatures.java | Interface defining modern functionalities like autoDrive() or enableGPS(). |
| Main.java | Entry point demonstrating class interaction and polymorphism. |
- Language: Java (JDK 17 or later)
- Paradigm: Object-Oriented Programming (OOP)
- Tools: IntelliJ IDEA, Eclipse, or VS Code
- Version Control: Git & GitHub
- Clone the repository
git clone https://github.com/HridaySharma2002/Vehicle-Management-System.git
- Open the project in your preferred Java IDE (IntelliJ, Eclipse, or VS Code).
- Compile and run
Main.java. - Observe console output demonstrating polymorphism and OOP interactions.
Vehicle car = new ElectricCar("Tesla", "Model S", 80000, 100);
Vehicle bike = new Bike("Royal Enfield", "Classic 350", 2500, true);
car.displayInfo(); // Displays electric car details
bike.displayInfo(); // Displays bike detailsOutput:
Vehicle: Tesla Model S
Price: 80000
Battery Capacity: 100 kWh
Smart Feature: Autopilot activated!
Vehicle: Royal Enfield Classic 350
Type: Manual Bike
Price: 2500
| Concept | Implementation |
|---|---|
| Abstraction | Vehicle serves as the base abstract class. |
| Encapsulation | Attributes are private with getters and setters. |
| Inheritance | ElectricCar and Bike extend Vehicle. |
| Polymorphism | displayInfo() behaves differently across subclasses. |
| Interfaces | ElectricVehicle and SmartFeatures define reusable contracts. |
- 💾 Implement persistent storage using files or databases.
- 🖥️ Add GUI using JavaFX or Swing for better user experience.
- 🔍 Introduce vehicle search and filter functionalities.
- 🚚 Extend the system with additional types (e.g., Truck, Bus, SUV).
Hriday Sharma
Software Engineering Graduate | Delhi, India
📧 Email: kshriday@gmail.com
🌐 GitHub: HridaySharma2002
This project currently has no license specified.
For academic and personal learning use only.