Generics in Java

  Рет қаралды 497,382

Telusko

Telusko

7 жыл бұрын

Spring and Microservices Live Course : bit.ly/springmslive
Coupon: TELUSKO25 (25% Discount)
Industry-Ready Java Spring Microservices Developer Live : bit.ly/JavaMS2
Complete Java Developer Course : bit.ly/Comp-Java-Dev-2
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusko.com/
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : 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 : - bit.ly/3LDMj8D
Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
Subscribe to our other channel:
Navin Reddy : / @navinreddy
Telusko Hindi :
/ @teluskohindi

Пікірлер: 166
@arkojyotisen1929
@arkojyotisen1929 4 жыл бұрын
Sir in this lockdown I have learned a lot in programming just because of you. Thank you so much
@nasreenmohsin
@nasreenmohsin 6 жыл бұрын
he explained it in very simple manner now i understand this concept hope he will upload more complex way to define generic
@willyang1770
@willyang1770 2 жыл бұрын
Thank you so much! I've been looking all over the internet for this and none of them were as good and straightforward as this! Thank You SO MUCH!
@queenskeleton4937
@queenskeleton4937 5 жыл бұрын
Best Java channel. Straightforward explanation, with code live demonstrated. You are sure to learn just by watching this. I learned from you in Spring Boot, REST services, and Java core APIs. Thank you so much!
@vikashemnani2371
@vikashemnani2371 3 жыл бұрын
Telesko is good but I would like you to check Java Brains channel of Kaushik, your view might change
@anthonycarella1779
@anthonycarella1779 5 жыл бұрын
Very straight-forward and easy to understand. Thanks for the content!
@aishwaryadash4166
@aishwaryadash4166 3 жыл бұрын
This is the single most important video if you want to be clear about Generics...Thank you!!
@MsElsospechoso28
@MsElsospechoso28 4 жыл бұрын
This guy is awesome, he really likes teaching which is highly appreciate it.
@gajeshtripathi5721
@gajeshtripathi5721 3 жыл бұрын
I was always confused with "? extends ..." & "? super ...." but now it is clear to me. Thanks Navin Sir.
@crankMiHoffer
@crankMiHoffer 5 жыл бұрын
7:35 mind blown; thank you for this video
@zhongweimao5548
@zhongweimao5548 4 жыл бұрын
Thank you so much Bro for your explanation. Your video resolved many of my confusion that even my lecturer was not able to solve coz she did not understand my confusion. Generics is much more clear now for me.
@farhaankazi7134
@farhaankazi7134 Жыл бұрын
in method definition of public void demo(ArrayList
@govindrudrawar2540
@govindrudrawar2540 4 жыл бұрын
lucid explanation. I have been watching ur videos for quite a while now. Thanks Navin Reddy. ur amazing.
@karanhaldar3401
@karanhaldar3401 9 ай бұрын
I can't understand this in my class but here I've cleared all of my confusions in one shot ❤❤❤❤ Thank u sir ❤❤
@nicksonmakama
@nicksonmakama 5 жыл бұрын
This really is the best video on Generics, I love it!
@manikandand2541
@manikandand2541 4 жыл бұрын
u have some enormous talent sir...plz continue this job..all the best
@fanwu281
@fanwu281 5 жыл бұрын
Thank you so much, it's very easy to understand!
@vladanulardzic5859
@vladanulardzic5859 4 жыл бұрын
100% explained ! Knowledge necessary for heavy solutions. Thank you. Keep on.
@mohitsinghrawat503
@mohitsinghrawat503 6 жыл бұрын
Awesome bro... Best Video I ever saw for Generics... Thanx man.
@sourabhbagade6932
@sourabhbagade6932 4 жыл бұрын
Even I m non it student, I m getting this concept clearly Thanks to telusko🙏👍
@dipagove8963
@dipagove8963 5 жыл бұрын
Thanks lot... for exact concept of java & all telusko videos to teach all technologies
@abhishekedu
@abhishekedu 4 жыл бұрын
The beauty of java is that before solving clients problem you have to solve java problems.
@i.d.1988
@i.d.1988 6 жыл бұрын
Another great video that helped me with understanding my school homework. Thank you sir.
@alisu111
@alisu111 5 жыл бұрын
Great video, now I understand the concept. Thanks a lot!
@2wardruid2
@2wardruid2 4 жыл бұрын
Thank You, your lesson helped me a lot!
@aminesfahani3563
@aminesfahani3563 3 жыл бұрын
The best explanation for Generics and Collection interface and Collections classes
@romeoacevedo1040
@romeoacevedo1040 4 жыл бұрын
Really nice explaination. Thanks for all the details!
@vineethnair4137
@vineethnair4137 3 жыл бұрын
Naveen sir your presentation is simple and understandable
@divyeshkumarbalar7732
@divyeshkumarbalar7732 6 жыл бұрын
your title music is damn scary if you have seen haunted on discovery channel
@wisniewz
@wisniewz 4 жыл бұрын
Read this as I was thinking the same thing. I'm dying over hear with that into music. LOL
@cori2852
@cori2852 4 жыл бұрын
as scary as generics in java
@mainakray6452
@mainakray6452 3 жыл бұрын
​@@cori2852 :))))))
@Fnaf-vh9cs
@Fnaf-vh9cs 2 жыл бұрын
This man is great I wish you a healthy and happy life and thanks for sharing.
@alexandernaywin8250
@alexandernaywin8250 3 жыл бұрын
Thank you so much, your generics explanation is awesome.
@contactamartya
@contactamartya 6 жыл бұрын
many many thanks ... superb video
@shrutikanachankar4932
@shrutikanachankar4932 Жыл бұрын
Thank You Sir🙏🏻. You taught it very well .
@abhinavgupta3387
@abhinavgupta3387 4 жыл бұрын
Good leason. I was easily able to understand the generics. Thanks.
@SanjayKmsd
@SanjayKmsd 5 жыл бұрын
You are simply awesome Navin
@mrrobot1289
@mrrobot1289 2 жыл бұрын
Very detailed explanation. THANK YOU!!!!
@Layarion
@Layarion 2 жыл бұрын
Now this was a good video. You didn't cut it too short and leave out some of the nuances like others do. Now i'ma go lookup that ? thing and Super.
@kiranvysya
@kiranvysya 2 жыл бұрын
I knew about Telusko from its inception but never liked or followed. But after seeing this one single lecture. Hands down never judge a book by its cover
@nasreenmohsin
@nasreenmohsin 6 жыл бұрын
need help confusion on following declaration why .. 1) class CalendarDate implements Comparable (when we implement Comparable we write in the end ) 2) class OrderPair implements Pair .... (in user define interface we write after Class can somebody explain it)
@nagendrasai3946
@nagendrasai3946 5 жыл бұрын
Well explained. Thank you very much
@Aryan46KingOfHearts
@Aryan46KingOfHearts 4 жыл бұрын
sir how to do that you have done at 10:49 to see which class/interface extends which class when i do that in eclipse by holding control something different shows up "source not found "
@mr.RAND5584
@mr.RAND5584 3 жыл бұрын
Entities have different type of class. Student class, employee class. Thanks i need to populate data from database as List
@ashuzguitar
@ashuzguitar 2 жыл бұрын
Thanks a ton Navin. You are the best!
@intsoumen
@intsoumen 7 жыл бұрын
Awesome Video I have ever seen , in short in 5 min Complete Compaq
@PatteeGreen
@PatteeGreen 2 жыл бұрын
Thank you!! Excellent explanation :)
@akchatsrivastava4209
@akchatsrivastava4209 5 жыл бұрын
Great method of teaching.
@aaratprasadchopra3255
@aaratprasadchopra3255 3 жыл бұрын
Thank You Navin, BIG Help!
@yonis963
@yonis963 5 жыл бұрын
clear explanation , thanks mate.
@madanpatel797
@madanpatel797 5 жыл бұрын
Hi Telusko, Could you please tell us how to access the java provided classes like List.class and Float.class. I use Eclipse as well but haven't figured it out yet. While doing so I am getting the following error: The JAR file C:\Program File\Java\jre1.8.0_201\lib t.jar has no source attachment.
@thomasflood8507
@thomasflood8507 6 жыл бұрын
Excellent!! Thank you very much indeed. .
@thatsenam9183
@thatsenam9183 6 жыл бұрын
such a awesome video. I loved it.
@muhammadmoersalin6846
@muhammadmoersalin6846 5 жыл бұрын
great explanation, thanks.
@A09550
@A09550 7 жыл бұрын
concise and clear, thanks
@shwetarautr01
@shwetarautr01 3 жыл бұрын
Hello sir! I need to know which subclass is sorted hashMap Or hashTable... ??? In case of.... Map m= new HashMap(); or HashTable() ;
@fluffy24
@fluffy24 2 жыл бұрын
You are really great my friend, tank you for your videos
@milad_mo
@milad_mo 3 жыл бұрын
It was good but please discuss about generic method and uses of generics in combination with reflection
@Ankit5311
@Ankit5311 5 жыл бұрын
Its similar to temlate in C++. They changed template to generics
@pranaytanniru7764
@pranaytanniru7764 4 жыл бұрын
It's clear, thank you.
@divyeshkumarbalar7732
@divyeshkumarbalar7732 5 жыл бұрын
I dont know why, but i am not being able to jump to implementation of any java inbuilt classes? Any help!
@TheCodeHunter
@TheCodeHunter 3 жыл бұрын
thank you so much for this!
@hiteshchalise3988
@hiteshchalise3988 5 жыл бұрын
This helped, thanks :)
@nynra6584
@nynra6584 7 жыл бұрын
Thank you for this well made explanation
@RohitKumar-wq9lk
@RohitKumar-wq9lk 9 ай бұрын
Bhai Mere mazza aa gya yaar
@tuweiIsaac
@tuweiIsaac 4 жыл бұрын
its good that such people do exist.#ilovetelusko
@schemerboy1005
@schemerboy1005 5 жыл бұрын
What if I want to use everything related to T (aka, both the supers and subclasses of T and also T itself?)
@blablablahh612
@blablablahh612 5 жыл бұрын
excellent video!!!!
@foton8998
@foton8998 4 жыл бұрын
thank you. It was effective
@ahsanali5527
@ahsanali5527 3 жыл бұрын
great explanation
@ayushchhanganni2357
@ayushchhanganni2357 2 жыл бұрын
Amazing content!!
@-indeed8285
@-indeed8285 6 жыл бұрын
BEST ever
@kylemanley915
@kylemanley915 3 жыл бұрын
Really good tutorial
@admannas123
@admannas123 3 жыл бұрын
Nice explanation
@studyonline3236
@studyonline3236 4 жыл бұрын
what's T extends Comparable ?
@shivaniverma7789
@shivaniverma7789 5 жыл бұрын
U r awsm sir😍😍
@harshitahuja5043
@harshitahuja5043 2 жыл бұрын
Excellent Video
@govardhangova5411
@govardhangova5411 2 жыл бұрын
sir in Hash map can we enter only key and values or we can enter one key no of values (like = sid,sname,address and phone )
@madanmohanpachouly6135
@madanmohanpachouly6135 2 жыл бұрын
Well Explained
@am-oo5uu
@am-oo5uu 5 жыл бұрын
Great video. Thank you so much. Could you tell me how to access the java proviced classes like List.class and Float.class. I use Eclipse as well but haven't figured it out yet.
@JimmyBFMV
@JimmyBFMV 5 жыл бұрын
Do you mean: How do you go to the implementation of List? Just right click --> Go To --> Implementation (or [Ctrl]+[Alt]+[B]).
@guambomber448
@guambomber448 3 жыл бұрын
WOW that was a great video!
@TsukiCTF
@TsukiCTF 7 жыл бұрын
Just asking, but what is the point of adding getters and setters in the class Container? From what I have tested so far, everything worked fine without those..
@djus5
@djus5 6 жыл бұрын
Everything worked fine without those because getter and setter for value were not used/called anywhere in the code. Point for adding those was just to show how generics works. For example, if you made object obj, like in the video: Container obj = new Container(); and you want to set value for it: obj.setValue("Java"); then compiler will know that T is String, public void setValue(T value); ----> public void setValue(String value);
@thehiddenbalkans
@thehiddenbalkans 3 жыл бұрын
Love the way you say "Dabl" & "GettaSetta" :D
@adityamishra2044
@adityamishra2044 3 жыл бұрын
9:05 when he laughed?
@mehrshadtavana1429
@mehrshadtavana1429 3 жыл бұрын
very helpful tnx a lot
@upengan78
@upengan78 4 жыл бұрын
Thank you sir 🤠
@neerajvas
@neerajvas 7 жыл бұрын
Excellent!!!!!
@ShujathHussain0
@ShujathHussain0 5 жыл бұрын
why LIST interface methods are not asked to be implemented? rather its optional but when we create a new interface and add some methods, they need to be used mandatorily.
@Goateduzi
@Goateduzi 5 жыл бұрын
Great video
@unemployedcse3514
@unemployedcse3514 2 жыл бұрын
Always Awesome ❤️
@ashokchilakala2879
@ashokchilakala2879 2 жыл бұрын
sir will u please provide the practical session videos
@dbaskaran22
@dbaskaran22 4 жыл бұрын
Good one.
@Ren-nf4pz
@Ren-nf4pz 3 жыл бұрын
very good thanks
@lemaaaron9009
@lemaaaron9009 Жыл бұрын
Thanks I love it 🤝
@PrometheanDesigns
@PrometheanDesigns 7 жыл бұрын
Thanks, bro. :-)
@blablablahh612
@blablablahh612 5 жыл бұрын
what if I want to use student class eg: Container obj=new Container(); how will i write my student class then? i am confused
@chakibbensari1850
@chakibbensari1850 3 жыл бұрын
The error at 3:37 is about Integer.parse() and not the List.add
4 жыл бұрын
Nice vid man!
@ammadnaseer7247
@ammadnaseer7247 4 жыл бұрын
Thanks boss!!
@TheDivyansh007
@TheDivyansh007 Жыл бұрын
Thank you :)
@addy0507
@addy0507 4 жыл бұрын
Thanks
@estleexin7584
@estleexin7584 5 жыл бұрын
thankyou!
@rahulchhetri906
@rahulchhetri906 6 жыл бұрын
Sir, well explained. But as I was also a student , from that point of view I can say that , this is the very basic concept of generics. It will be really great if you make some videos on 'errasure and generics'. I think this is the most confusing part of generics. If you could explain that in easy way, the way you have been doing, it would be very beneficial for students out there.....
@adharsh200
@adharsh200 6 жыл бұрын
Good Video :)
14.2 Collection and Generics in Java |  Practical
14:33
Telusko
Рет қаралды 289 М.
Stream API in Java
26:04
Telusko
Рет қаралды 266 М.
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 46 МЛН
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 57 МЛН
Be kind🤝
00:22
ISSEI / いっせい
Рет қаралды 21 МЛН
когда достали одноклассники!
00:49
БРУНО
Рет қаралды 3,6 МЛН
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
🔥Generic in one video | Java Generic Full concept in 23 min in Hindi
23:49
Learn Code With Durgesh
Рет қаралды 62 М.
Introduction to Generics (Type Safety)
15:04
Durga Software Solutions
Рет қаралды 147 М.
Java Generics Tutorial
18:12
Programming with Mosh
Рет қаралды 61 М.
Collection and Generics in Java
14:32
Telusko
Рет қаралды 762 М.
Interview Question | Comparable vs Comparator in Java
12:58
Telusko
Рет қаралды 638 М.
Java generics ❓
22:04
Bro Code
Рет қаралды 98 М.
14.5 LinkedList vs ArrayList in Java
9:16
Telusko
Рет қаралды 402 М.
Learn TypeScript Generics In 13 Minutes
12:52
Web Dev Simplified
Рет қаралды 210 М.
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 46 МЛН