Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nav7fsc/vehicleandcarproject
https://github.com/nav7fsc/vehicleandcarproject
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/nav7fsc/vehicleandcarproject
- Owner: nav7FSC
- Created: 2024-08-31T04:38:04.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T01:29:32.000Z (5 months ago)
- Last Synced: 2024-11-25T07:51:41.311Z (2 months ago)
- Language: Java
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.