Java Generics Tutorial

  Рет қаралды 178,882

Keep On Coding

Keep On Coding

4 жыл бұрын

Twitch: / keeponcoding
Instagram: / keep_on_coding
Discord: / discord
My Gear: amazon.com/shop/keeponcoding
#keeponcoding #tech #programming

Пікірлер: 303
@KeepOnCoding
@KeepOnCoding 3 жыл бұрын
☕Want to master Java? Get my complete Java course: bit.ly/42mQlXE
@lindawisebear
@lindawisebear 3 жыл бұрын
This is the best explanation of Generics I've seen on the internet. I loved how you started with the problem to solve, and then showed how generics is useful when tackling that problem :)
@999loaderu
@999loaderu 2 жыл бұрын
true dat. Fell the same
@gauravmishra8782
@gauravmishra8782 2 жыл бұрын
True
@KnakuanaRka
@KnakuanaRka 3 жыл бұрын
Also, something else to add about generics: If you’re expecting some specific property of the class you put into a generic, you can write that into your generic. For example, if your class had an array of T’s that you wanted to sort, just putting MyClass will make your compiler complain that you’re doing something unsafe. This is because you can only use sort() on the array if the class T implements the Comparable interface and its compareTo() method, and there’s no guarantee someone won’t try to make it with some class Java doesn’t know how to compare or sort (like a custom one). The solution here? Write your class header as MyClass. This tells the compiler that you will only make MyClass’es with types that can be sorted. This uses “extends” as opposed to the “implements” usually used for interfaces because you’re just making a promise about the generic class, not actually implementing one, and the second T is because Comparable is also generic (so you need to say that T implements a method to compare T objects specifically).
@eustachybakielka
@eustachybakielka 3 жыл бұрын
It's not because of reification of arrays?
@KnakuanaRka
@KnakuanaRka 3 жыл бұрын
@@eustachybakielka Not sure what you’re referring to.
@eustachybakielka
@eustachybakielka 3 жыл бұрын
@@KnakuanaRka "For example, if your class had an array of T’s that you wanted to sort, just putting MyClass will make your compiler complain that you’re doing something unsafe"
@KnakuanaRka
@KnakuanaRka 3 жыл бұрын
@@eustachybakielka What the heck is reification of arrays?
@eustachybakielka
@eustachybakielka 3 жыл бұрын
@@KnakuanaRka What is reification in Java? In the context of Java as a programming language, reification is the process by which a user program or any aspect of a programming language that was implicit in the translated program and the run-time system, are expressed in the language itself. In Java, there exist "reifiable types" that are "completely available at run time" (i.e. their information is not erased during compilation). Example: //Allocates an array of type String, so it is reified String[] aStringArray = new String[10]; //Allocates a list with no type, Java does not reify generic types List aStringList = new ArrayList();
@philippebaillargeon5204
@philippebaillargeon5204 3 жыл бұрын
I like the way you explain things: Java developers created Generics to solve a problem, so I think its pretty logical to talk about the problem before talking about the concepts that were created to solve it. Great video !
@mastershonobi110
@mastershonobi110 2 жыл бұрын
Super great point(illustrate the problem to solve, before the concept). A lot of Java Channels should be taking notes!!
@angledcoathanger
@angledcoathanger 2 жыл бұрын
Totally agree - it's hard to get excited about a key if you haven't seen the lock that it opens
@abdullahmajed7554
@abdullahmajed7554 3 жыл бұрын
that was really simple i love the way you edit the video making switch between you and the code it feels so clean, thank you
@mohannadfadhal4282
@mohannadfadhal4282 2 жыл бұрын
Thank you so much, Sir. You made the explanation for generics very simplified, especially, by the style of starting with the problem first and then showing the solution! 🤩
@deeptimonga7375
@deeptimonga7375 4 жыл бұрын
Keep On Making such videos on Keep On Coding channel. Really Helpful !!
@KeepOnCoding
@KeepOnCoding 4 жыл бұрын
Thanks for watching Deepti!
@TS-wj4im
@TS-wj4im 3 жыл бұрын
Dude thank you. My text book way over complicated generics. Now it all makes sense.
@fredericoamigo
@fredericoamigo Жыл бұрын
Thank you so much for this! I love your Java tutorials. So simple, clean and explanatory. Keep up the good work!
@JosephGallagher
@JosephGallagher 11 ай бұрын
This is the most concise and easy to understand video I've seen so far on Generics, thank you so much :D
@philyeo
@philyeo 2 жыл бұрын
awesome stuff. I liked the way you explained it - showing the problem first and how generics can help save the day!
3 жыл бұрын
Wow! You explained it all so good. I finally feel like I understand this. Thank you so much. Please keep it coming.
@hannahc8436
@hannahc8436 2 жыл бұрын
This was such a great explanation of Generics. I've been so confused about it for the past few weeks. Thank you!!
@shreypatel9379
@shreypatel9379 3 жыл бұрын
This was the best explanation on youtube, short and concise. Thank you and keep making such videos
@delmayank
@delmayank 3 жыл бұрын
Lounge Coding! I really liked the theme. A new touch to coding tutorials. I am your fan now. You rock! Oh! And the stuff that you covered in this tutorial is of great value. You explained it easily and flawlessly.
@shagiwan
@shagiwan 2 жыл бұрын
Second year of studying Software Development in Uni and this is just the best explanation ive heard! Great job man!
@IgorBeneli1014
@IgorBeneli1014 3 жыл бұрын
You're incredible you explained with 12min a concept that my professor couldn't do it with 1 hour. Keep doing this amazing job thank you so much!
@BoetFly
@BoetFly 4 жыл бұрын
Man, thank you so much, i finally understand those generics now :D
@prabhakarlal4799
@prabhakarlal4799 3 жыл бұрын
Nice and simplified explanation of a complicated topic. Thank you.
@isah.2980
@isah.2980 3 жыл бұрын
Thank you so much! Please, keep doing videos like this!
@conea6891
@conea6891 3 жыл бұрын
I like this fast paced explanation.
@ziekaman2450
@ziekaman2450 2 жыл бұрын
Thankyou so much. You're very talented in explaining complicated Java thingys!
@himanshushukla787
@himanshushukla787 2 жыл бұрын
bro your java playlist is so underrated. I love it
@anx007d
@anx007d 2 жыл бұрын
Thank You very much .. after looking many videos from different sources ....... this video absolutely cleared my thoughts for Java Generics.
@LIP45GUL
@LIP45GUL 4 жыл бұрын
Great video, thanks for explaining so well!
@CarlosRamirez-uz7hs
@CarlosRamirez-uz7hs 3 жыл бұрын
Great video man, keep doing what you do
@PrakashVl
@PrakashVl 3 жыл бұрын
This tutorial is helpful for filling the gaps in generics, thanks for explaining thoroughly.
@gauravkumarsingh640
@gauravkumarsingh640 3 жыл бұрын
This is legit the best video I could find to understand Generics!
@RubenGarciaCS
@RubenGarciaCS 3 жыл бұрын
Excellent quality! Thank you
@19sunheart96
@19sunheart96 2 жыл бұрын
Nice video! Very easy to understand explanation of the concept.
@alexmedina5135
@alexmedina5135 3 жыл бұрын
what a good, easy, and elegant way to explain generics ... keep it up!!
@abhijeetmokale9024
@abhijeetmokale9024 3 жыл бұрын
Seriously this way of learning from the problem is amazing! Thanks Sir!!
@leonrickert4061
@leonrickert4061 4 жыл бұрын
Keep on man, cool teaching style
@89pravinb
@89pravinb 2 жыл бұрын
Thank you for creating this video! Very concise and informative
@monetoast
@monetoast 3 жыл бұрын
Exceptional video, very clear!
@TKollaKid
@TKollaKid 2 жыл бұрын
Great explanation - clear and helpful. Thank you.
@olegc6209
@olegc6209 3 жыл бұрын
Awesome explanation, thanks for your help!
@2010aishwary
@2010aishwary 3 жыл бұрын
very nice to the point video, subbed
@okikiomisande8732
@okikiomisande8732 Жыл бұрын
Awesome explaination, thank you!
@AshBeastreal
@AshBeastreal 2 жыл бұрын
Wow this is one of the best explainer videos. Loved watching it🤩
@ledtargaouschi5831
@ledtargaouschi5831 3 жыл бұрын
Your videos are very helpful and your teaching methods are very clear
@fahadtahir6
@fahadtahir6 3 жыл бұрын
Very informative and loved your communication style
@lurkhidden9126
@lurkhidden9126 3 жыл бұрын
Learned hella! Good looks my guy
@anithachowdary9716
@anithachowdary9716 3 жыл бұрын
I understood the topic very well.Thank you so much Please share more videos
@Burak-cr6um
@Burak-cr6um 2 жыл бұрын
Thank you, It was very helpful as usual.
@qwarlockz8017
@qwarlockz8017 3 жыл бұрын
Nice video. You do have a great way of explaining things.
@aavocadoToast
@aavocadoToast 3 жыл бұрын
Great video! Detailed and to the point.
@damyandimitrov611
@damyandimitrov611 3 жыл бұрын
Very well explanation and approach
@999loaderu
@999loaderu 2 жыл бұрын
really well explained m8. Appreciate it. thx
@morolillyshean8816
@morolillyshean8816 2 жыл бұрын
Yes, this is the best one I found. Thanks!
@tetsuorulin9009
@tetsuorulin9009 2 жыл бұрын
I love teaching to the problem. Great video and thanks!
@chinemelumj5349
@chinemelumj5349 2 жыл бұрын
Finally understood generics, thank you so much!.
@kylemanley915
@kylemanley915 3 жыл бұрын
Sweet tutorial, just subscribed
@leslyp.blaise7238
@leslyp.blaise7238 3 жыл бұрын
Explanation clear and concise thank you
@faikyesilyaprak8761
@faikyesilyaprak8761 3 жыл бұрын
That was lit bro!!!! Thanks for crystal clear explanation :))))
@premalupadhyay3555
@premalupadhyay3555 3 жыл бұрын
Great and simple explanation, I like this way of teaching a lot.
@williamfernandesdorante6068
@williamfernandesdorante6068 3 жыл бұрын
WOW' You're good at teaching code and concepts. Way to go!
@wovasteengova
@wovasteengova 3 жыл бұрын
This looks like it's from java, a beginner's guide. I too was confused on what generics fix but thank you for explaining it in the beginning of the video. I think you should do that to all your videos
@earl0fBronze
@earl0fBronze 3 жыл бұрын
I read a thirty page chapter on this, one ear out the other. This video is outstanding, mind blown.
@ItsTheDannyShow
@ItsTheDannyShow 4 жыл бұрын
Subscribing man. You helped so much.
@saintfrancisbeats9639
@saintfrancisbeats9639 3 жыл бұрын
Dope! I am currently in an Intermediate Programming college course and they just want us to read a document. I was so lost. This clarified alot. Also it cause me to switch from Netbeans to IntelliJ IDEA hahaha
@lazpz617
@lazpz617 Жыл бұрын
This video really helped me understand Generics way more than my instructors classes
@lancelotlin3459
@lancelotlin3459 3 жыл бұрын
Best tutorial! Thanks for your explanation!
@nikeshparajuli6345
@nikeshparajuli6345 4 жыл бұрын
it's really helpful,thanks a lot .
@timo_b3
@timo_b3 3 жыл бұрын
Thank you, excellent explanation!
@abidali5131
@abidali5131 3 жыл бұрын
Thank you, I learnt something new today
@kaifahsan8459
@kaifahsan8459 4 жыл бұрын
Thanks for the video mate. Pretty well explained. Would be awesome if you keep making videos about core and advanced OOP concepts like this.
@KeepOnCoding
@KeepOnCoding 4 жыл бұрын
Thank you sir. Did you have a specific topic in mind?
@kaifahsan8459
@kaifahsan8459 4 жыл бұрын
Probably topics like interfaces, polymorphism, exceptions, collection frameworks etc. There's a huge Quora thread that might help you as well: www.quora.com/What-is-a-complete-list-of-topics-of-Core-Java-and-topics-of-Advanced-Java
@KeepOnCoding
@KeepOnCoding 4 жыл бұрын
Awesome! Thanks!
@kalyanmatamarugu9396
@kalyanmatamarugu9396 3 жыл бұрын
Clean, simple and perfect content!
@gmailservice9945
@gmailservice9945 2 жыл бұрын
very useful and well explained. thank you
@irenaslavova2041
@irenaslavova2041 3 жыл бұрын
Very helpful for me, thanks!
@sjakie0420
@sjakie0420 2 жыл бұрын
Thanks, very clear explanation
@thomi100
@thomi100 Жыл бұрын
Very well explained, thanks!
@tamimjabr1648
@tamimjabr1648 3 жыл бұрын
You are awesome bro, thank you for this video
@MrMarkjams
@MrMarkjams 4 жыл бұрын
This is a great video! Could you do one on Interfaces?
@dalvandi
@dalvandi 3 жыл бұрын
Possibly one of the best, clearest, and crispest explanations on the generic class that I've seen! Keep up the great content dude!
@ramiayash7658
@ramiayash7658 3 жыл бұрын
i highly agree with you, the guy is so clear with his explanations
@technocoh
@technocoh Жыл бұрын
Amazing, simple explanation, thank you! =D
@tolstoievski4926
@tolstoievski4926 2 жыл бұрын
You can also declare generic type at method scope id you're planning to use static methods (methods that are not requiring you to instantiate class to use it)
@ravenmadd1343
@ravenmadd1343 3 жыл бұрын
Why can't everything be explained this clearly and quickly? Thanks for doing this and keep up the good work.
@bibahbibah5108
@bibahbibah5108 2 жыл бұрын
i like the u develop the subject, uake java very easy to work with
@SaljooqAltaf
@SaljooqAltaf 3 жыл бұрын
This just might be personal preference but the best and most detailed explanations for anyone studying comp sci are found in this channel - no idea why views haven't hit a million
@nisarullah7734
@nisarullah7734 3 жыл бұрын
Great work keep it up
@beatakazmierczak2543
@beatakazmierczak2543 2 жыл бұрын
Simply explained! Thank you!
@101matthias
@101matthias 3 жыл бұрын
I just watched 9 hours of online classes from my teacher on generics and I understood nothing. Less than nothing. 10 minutes of you and everything is clear it's super easy actually.
@technocoh
@technocoh Жыл бұрын
yeah not every professional or teacher is able to share his knowledge the proper way... ;)
@pinolskun8764
@pinolskun8764 Жыл бұрын
@@technocoh yeah if someone need 9 hours to explain a concept you can safely assume they are the first who don't understand it
@himangshuchowdhary4369
@himangshuchowdhary4369 2 жыл бұрын
Great explanation KOC!
@ritexcorp
@ritexcorp Жыл бұрын
That was a great explanation of Generics, keep up the good work, I just subscribed to your channel. Do you have something on Java annotations?
@fernandaribeiro2231
@fernandaribeiro2231 3 жыл бұрын
oh my God, thank you so much!!! you make this look easier
@chikken007
@chikken007 3 жыл бұрын
Great explanation! Just gained a new Sub. Thank you and keep it up please!
@athardaif863
@athardaif863 3 жыл бұрын
I was struggeling with understanding generics until I watched your video. Thanks a lot :)
@MrDoctorSchultz
@MrDoctorSchultz 3 жыл бұрын
Smooth, informative, and straight to the point. Keep up the good work!
@arnabmukherjee5840
@arnabmukherjee5840 4 жыл бұрын
Awesome tutorial bro
@porkfreegaming5278
@porkfreegaming5278 2 жыл бұрын
You are awesome! thank you good sir
@xsendilien9551
@xsendilien9551 4 жыл бұрын
Really awesome bro!
@cirodecarlineto2483
@cirodecarlineto2483 3 жыл бұрын
Thnks for the vid sam!!
@sultanrecords1362
@sultanrecords1362 3 жыл бұрын
Very Nice Explanation
@Officially_fit
@Officially_fit 2 жыл бұрын
This guy is just amazing
@toniiicarbonelll287
@toniiicarbonelll287 3 жыл бұрын
MAAAAAAAAAAAAAAAAAN that was just awesome thank you very much!
@netrob
@netrob 2 жыл бұрын
Well explained. Thanks!
@buddhikachathuranga2968
@buddhikachathuranga2968 2 жыл бұрын
love the way you teach
@mimischly2547
@mimischly2547 3 жыл бұрын
thanks man great explanation
@anugrahps6463
@anugrahps6463 4 жыл бұрын
I really kind of like the way you present bru keep onn
Array List vs Linked List | Which one should you use??
7:57
Keep On Coding
Рет қаралды 57 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 36 МЛН
小路飞姐姐居然让路飞小路飞都消失了#海贼王  #路飞
00:47
路飞与唐舞桐
Рет қаралды 93 МЛН
Normal vs Smokers !! 😱😱😱
00:12
Tibo InShape
Рет қаралды 113 МЛН
it takes two to tango 💃🏻🕺🏻
00:18
Zach King
Рет қаралды 26 МЛН
Object Oriented Programming - The Four Pillars of OOP
11:23
Keep On Coding
Рет қаралды 309 М.
Java Interface Tutorial
14:49
Keep On Coding
Рет қаралды 128 М.
Java generics ❓
22:04
Bro Code
Рет қаралды 97 М.
JHU Computer Science: The Master's Program Experience
1:11
Johns Hopkins Whiting School of Engineering
Рет қаралды 7 М.
Java Enum Tutorial
6:23
Keep On Coding
Рет қаралды 46 М.
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 194 М.
Inner Class Java Tutorial - Creating and Using Inner Classes
8:21
Coding with John
Рет қаралды 121 М.
Explain Generics in C#? When and why to use them in real applications?
5:57
Java Streams Tutorial
7:56
Keep On Coding
Рет қаралды 110 М.
What Is JetBrains Academy?
2:06
JetBrains Academy
Рет қаралды 1,5 М.
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 36 МЛН