This repository contains Java examples of the use of generics, abstract classes, inheritance, and type-safe collections. It is structured to provide simple, clear demonstrations of these core concepts.
- Abstract Class
Car: Base class representing common car properties; - Concrete Car Classes: Multiple concrete classes extending
Carto demonstrate inheritance; - Generics Example: Uses generic lists (
List<T>) and wildcard methods to print elements in a type-safe way; - Main App Class: Demonstrates object creation, inheritance, list usage, and printing elements with a static generic method.
- Added generic list example that uses
Tand static method with wildcard; - Renamed
genericmodelspackage togeneric; - Created
Appmain class to display car information; - Created
Carabstract class and three concrete car classes with inheritance; - Overrode
toString()inCarfor clear display in lists.
- Created starting project structure and initial class files;
- Added
.gitignoreto project.