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
Car
to 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
T
and static method with wildcard; - Renamed
genericmodels
package togeneric
; - Created
App
main class to display car information; - Created
Car
abstract class and three concrete car classes with inheritance; - Overrode
toString()
inCar
for clear display in lists.
- Created starting project structure and initial class files;
- Added
.gitignore
to project.