filmov
tv
Java Generics Tutorial - 053
Показать описание
At some point you've likely heard about Java generics. Generics were introduced into the Java language in Java 5. In the next few videos, we're going to take a deep dive into what generics are, how to use them, and ultimately how to create our own Java generics.
A generic is a class that acts like a template for creating classes. In this case, we define how the list works without stating what classes the list holds. We'll have add and remove methods, but we won't say what class we're adding and removing until we define the instance. Once we instantiate our class, we'll tell it the type our list works with. No other type is allowed. Using a generic class gives us type safety.
#java #programming #tutorial #generics
▼
▼
▼
Concepts: Java generics, Java
Social Links: Don't hesitate to contact me if you have any further questions.
Related Videos:
Media credits: All images are owned by DJ Spiess or used under CC0 unless listed below
A generic is a class that acts like a template for creating classes. In this case, we define how the list works without stating what classes the list holds. We'll have add and remove methods, but we won't say what class we're adding and removing until we define the instance. Once we instantiate our class, we'll tell it the type our list works with. No other type is allowed. Using a generic class gives us type safety.
#java #programming #tutorial #generics
▼
▼
▼
Concepts: Java generics, Java
Social Links: Don't hesitate to contact me if you have any further questions.
Related Videos:
Media credits: All images are owned by DJ Spiess or used under CC0 unless listed below
Комментарии