Java Generics complete tutorial | What is the use of generics in Java | how to use java generics

preview_player
Показать описание
Let's Build a Community of Programmers.
****************************************************************************************
The Java Generics allows us to create a single class, interface, and method that can be used with different types of data (objects). This helps us to reuse our code. Note: Generics does not work with primitive types ( int , float , char , etc).

What is the use of generics in Java?
Java Generics helps the programmer to reuse the code for whatever type he/she wishes. For instance, a programmer writes a generic method for sorting an array of objects. Generics allow the programmer to use the same method for Integer arrays, Double arrays, and even String arrays.

****************************************************************************************
#java
Рекомендации по теме
Комментарии
Автор

I just found your channel, it is very informative and easy to understand, thank you for the video

PostToasties
visit shbcf.ru