Generics in Java

Publicado em: 02 December 2016
no canal de: Telusko
510,655
6.3k

Check out our courses:

Spring and Microservices Weekend Live Batch : https://bit.ly/spring-live-weekend
Coupon: TELUSKO10 (10% Discount)

Master Java Spring Development : https://bit.ly/java-spring-cloud

For More Queries WhatsApp or Call on : +919008963671

website : https://courses.telusko.com/

Instagram :   / navinreddyofficial  
Linkedin :   / navinreddy20  
TELUSKO Android App : https://bit.ly/TeluskoApp
Discord :   / discord  

In a nutshell, generics enable types (classes and interfaces) to be parameters when defining classes, interfaces and methods.
Much like the more familiar formal parameters used in method declarations, type parameters provide a way for you to re-use the same code with different inputs.
The difference is that the inputs to formal parameters are values, while the inputs to type parameters are types.

Code that uses generics has many benefits over non-generic code:
Stronger type checks at compile time.
A Java compiler applies strong type checking to generic code and issues errors if the code violates type safety.
Fixing compile-time errors is easier than fixing runtime errors, which can be difficult to find.
Elimination of casts.
Enabling programmers to implement generic algorithms.
By using generics, programmers can implement generic algorithms that work on collections of different types, can be customized, and are type safe and easier to read.

In this video we will see :
What is Generics
What is Type-safe Language
How to achieve type safety
An example or program of Generics implementation in Java

Java and Spring Framework For beginners with Spring Boot : - http://bit.ly/3LDMj8D

Java Tutorial for Beginners (2023) :- http://bit.ly/3yARVbN

Subscribe to our other channel:
Navin Reddy :    / @navinreddy  
Telusko Hindi :
   / @teluskohindi  


Nesta página do site você pode assistir ao vídeo on-line Generics in Java duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Telusko 02 December 2016, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 510,655 vezes e gostou 6.3 mil espectadores. Boa visualização!