Skip to content

The Vehicle Management System is a Java project demonstrating OOP concepts like encapsulation, inheritance, method overriding, upcasting, and downcasting. It includes a base Vehicle class with Car and Bike subclasses to showcase real-world object relationships.

Notifications You must be signed in to change notification settings

KanugantiHaripriya/pentaGon-vms-java-project1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Vehicle Management System - Java Project-1

🎯 Objective

Design a simple Vehicle Management System in Java demonstrating key OOP concepts such as:

  • Encapsulation
  • Inheritance
  • Method Overriding
  • Upcasting
  • Downcasting

βœ… Requirements

1. πŸ”’ Encapsulation

  • Create a base class Vehicle with private fields:
    • brand (String)
    • speed (int)
  • Provide public getter and setter methods for these fields.

2. 🧬 Inheritance

Create two subclasses extending the Vehicle class:

  • Car

    • Additional field: fuelType (String)
  • Bike

    • Additional field: engineCC (int)

3. πŸ” Method Overriding

  • Override the showDetails() method in both Car and Bike classes to provide specific vehicle details.

4. πŸ”ΌπŸ”½ Upcasting and Downcasting

  • Upcasting:
    Assign Car and Bike objects to Vehicle type references.

  • Downcasting:
    Convert Vehicle references back to Car and Bike to access subclass-specific properties.


πŸ“ Project Structure

.settings/
└── (various Eclipse settings files)
bin/
src/
└── Project1/
    β”œβ”€β”€ Bike.java
    β”œβ”€β”€ Car.java
    β”œβ”€β”€ Test.java
    β”œβ”€β”€ Vehicle.java
    └── module-info.java
.classpath
.project
README.md

πŸ’» Sample Output

Car fuel Type is : petrol
Bike engine cc is : 1000
Brand is : Range Rover
Speed is : 1000
Brand is : BMW
Speed is : 1000


πŸ› οΈ Technologies Used

  • Java (OOP Concepts)

About

The Vehicle Management System is a Java project demonstrating OOP concepts like encapsulation, inheritance, method overriding, upcasting, and downcasting. It includes a base Vehicle class with Car and Bike subclasses to showcase real-world object relationships.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages