Generics in Java

Опубликовано: 02 December 2016
на канале: 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  


На этой странице сайта вы можете посмотреть видео онлайн Generics in Java длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Telusko 02 December 2016, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 510,655 раз и оно понравилось 6.3 тысяч зрителям. Приятного просмотра!