This Java-based project demonstrates the fundamental concepts of Object-Oriented Programming (OOP), including inheritance, method overloading, method overriding, and constructor chaining, through a simple Vehicle Management System.
- Base Class (
Vehicle): Stores basic vehicle details. - Derived Class (
Car): Adds fuel type and overloads thestartEngine()method. - Derived Class (
Bike): Adds engine capacity and overrides thedisplayInfo()method. - Constructor Overloading and Chaining.
- Method Overloading & Overriding.
- Encapsulation of Vehicle Data.
com.assignment/ βββ Vehicle.java βββ Car.java βββ Bike.java βββ Main.java
| Concept | Implemented In |
|---|---|
| Inheritance | Car and Bike extend Vehicle |
| Method Overriding | displayInfo() in Car and Bike |
| Method Overloading | startEngine() in Car |
| Constructor Chaining | Using super() in child class constructors |
| Copy Constructor | Vehicle(Vehicle v) |
Brand: Toyota, Model: Camry, Year: 2022 Vehicle engine is starting... Brand: Honda, Model: Civic, Year: 2023 Fuel Type: Petrol Vehicle engine is starting... Car engine is starting using Push Button Brand: Yamaha, Model: R15, Year: 2021 Engine Capacity: 155cc Vehicle engine is starting...
1. Clone the Repository
git clone https://github.com/palatul16/Vehicle_Management_Repositary
cd vehicle-management-system
2. Compile the Code
javac com/assignment/*.java
3. Run the Program
java com.assignment.Main
Atul Pal
Feel free to connect.