Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nav7fsc/vehicleandcarproject


https://github.com/nav7fsc/vehicleandcarproject

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# Vehicle and Car Java Project

## Overview

This project demonstrates the creation of a basic Java class hierarchy with a `Vehicle` class and a `Car` class. The `Car` class extends `Vehicle` and includes additional attributes and methods.

## Project Structure:

- **Vehicle.java**: Defines a `Vehicle` class with attributes `numberOfWheels`, `color`, `engineSize`, and `fuelType`.
- **Car.java**: Extends `Vehicle`, adding the `brand` attribute and methods like `honk()` and `displayInfo()`.
- **Main.java**: Contains the `main` method to test the classes by creating instances of `Vehicle` and `Car` and invoking their methods.

## Example Output

- Honk, honk!
- Car Details:
- Brand: Volvo
- Number of Wheels: 4
- Color: Yellow
- Engine Size: 2.5 liters
- Fuel Type: Petrol

## How to Run
## Prerequisites:

- **IntelliJ IDEA**: Ensure that IntelliJ IDEA is installed on your system.
- **Java SDK**: Make sure Java SDK is installed and configured.

## Project Files:

- Vehicle.java: Defines the Vehicle class with attributes for general vehicle properties.
- Car.java: Defines the Car class, extending Vehicle with additional attributes and methods specific to cars.
- Main.java: Provides a main method for testing the classes, creating instances, and invoking methods.
- README.md: This file, providing an overview and detailed instructions for the project.