The Course Intro project is a console-based Java application designed to explore inheritance and polymorphism through a vehicle-themed example. Users interact with various types of vehicles, demonstrating shared and specialized behavior, as well as static and instance methods.
This project is an educational exercise focused on teaching object-oriented programming concepts like inheritance, method overriding, and the use of polymorphism.
-
Vehicle Management:
- Demonstrates a base
Vehicleclass with shared attributes and methods. - Specialized subclasses (
CarandMotorcycle) that extendVehiclewith additional features.
- Demonstrates a base
-
Dynamic Behavior:
- Method overriding in subclasses to provide custom behavior.
- Polymorphism illustrated through an array of
Vehicleobjects.
-
Static and Instance Methods:
- Showcases static methods for class-level operations.
- Highlights instance methods for object-specific functionality.
-
Interactive Console Output:
- Displays features of different vehicle types.
- Custom animations and separators for enhanced readability.
-
Main Application:
Main.java: The entry point, showcasing various features of vehicles through method calls and polymorphism.
-
Vehicle Classes:
Vehicle.java: The base class defining common properties likebrandandspeed, and methods for displaying features.Car.java: ExtendsVehicle, adding anumberOfDoorsattribute and custom behavior.Motorcycle.java: ExtendsVehicle, adding ahasSidecarattribute and custom methods.
This project serves as a practical introduction to object-oriented design principles, providing a hands-on approach to inheritance, method overriding, and polymorphism in Java. It is a fun and engaging way to learn the basics of OOP through relatable examples.