Java Generics Tutorial

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

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!
@fredericoamigo
@fredericoamigo Жыл бұрын
Thank you so much for this! I love your Java tutorials. So simple, clean and explanatory. Keep up the good work!
3 жыл бұрын
Wow! You explained it all so good. I finally feel like I understand this. Thank you so much. Please keep it coming.
@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.
@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!
@TS-wj4im
@TS-wj4im 3 жыл бұрын
Dude thank you. My text book way over complicated generics. Now it all makes sense.
@shreypatel9379
@shreypatel9379 3 жыл бұрын
This was the best explanation on youtube, short and concise. Thank you and keep making such videos
@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!!
@shagiwan
@shagiwan 2 жыл бұрын
Second year of studying Software Development in Uni and this is just the best explanation ive heard! Great job man!
@BoetFly
@BoetFly 4 жыл бұрын
Man, thank you so much, i finally understand those generics now :D
@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!
@anx007d
@anx007d 2 жыл бұрын
Thank You very much .. after looking many videos from different sources ....... this video absolutely cleared my thoughts for Java Generics.
@CarlosRamirez-uz7hs
@CarlosRamirez-uz7hs 3 жыл бұрын
Great video man, keep doing what you do
@ziekaman2450
@ziekaman2450 2 жыл бұрын
Thankyou so much. You're very talented in explaining complicated Java thingys!
@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!
@LIP45GUL
@LIP45GUL 4 жыл бұрын
Great video, thanks for explaining so well!
@conea6891
@conea6891 3 жыл бұрын
I like this fast paced explanation.
@abhijeetmokale9024
@abhijeetmokale9024 3 жыл бұрын
Seriously this way of learning from the problem is amazing! Thanks Sir!!
@AshBeastreal
@AshBeastreal 2 жыл бұрын
Wow this is one of the best explainer videos. Loved watching it🤩
@19sunheart96
@19sunheart96 2 жыл бұрын
Nice video! Very easy to understand explanation of the concept.
@leonrickert4061
@leonrickert4061 4 жыл бұрын
Keep on man, cool teaching style
@RubenGarciaCS
@RubenGarciaCS 3 жыл бұрын
Excellent quality! Thank you
@himanshushukla787
@himanshushukla787 2 жыл бұрын
bro your java playlist is so underrated. I love it
@PrakashVl
@PrakashVl 3 жыл бұрын
This tutorial is helpful for filling the gaps in generics, thanks for explaining thoroughly.
@89pravinb
@89pravinb 3 жыл бұрын
Thank you for creating this video! Very concise and informative
@2010aishwary
@2010aishwary 3 жыл бұрын
very nice to the point video, subbed
@alexmedina5135
@alexmedina5135 3 жыл бұрын
what a good, easy, and elegant way to explain generics ... keep it up!!
@gauravkumarsingh640
@gauravkumarsingh640 3 жыл бұрын
This is legit the best video I could find to understand Generics!
@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
@TKollaKid
@TKollaKid 2 жыл бұрын
Great explanation - clear and helpful. Thank you.
@kylemanley915
@kylemanley915 3 жыл бұрын
Sweet tutorial, just subscribed
@ItsTheDannyShow
@ItsTheDannyShow 4 жыл бұрын
Subscribing man. You helped so much.
@okikiomisande8732
@okikiomisande8732 Жыл бұрын
Awesome explaination, thank you!
@lurkhidden9126
@lurkhidden9126 3 жыл бұрын
Learned hella! Good looks my guy
@aavocadoToast
@aavocadoToast 3 жыл бұрын
Great video! Detailed and to the point.
@monetoast
@monetoast 3 жыл бұрын
Exceptional video, very clear!
@ledtargaouschi5831
@ledtargaouschi5831 3 жыл бұрын
Your videos are very helpful and your teaching methods are very clear
@olegc6209
@olegc6209 3 жыл бұрын
Awesome explanation, thanks for your help!
@fahadtahir6
@fahadtahir6 3 жыл бұрын
Very informative and loved your communication style
@Burak-cr6um
@Burak-cr6um 2 жыл бұрын
Thank you, It was very helpful as usual.
@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)
@damyandimitrov611
@damyandimitrov611 3 жыл бұрын
Very well explanation and approach
@qwarlockz8017
@qwarlockz8017 3 жыл бұрын
Nice video. You do have a great way of explaining things.
@anithachowdary9716
@anithachowdary9716 3 жыл бұрын
I understood the topic very well.Thank you so much Please share more videos
@999loaderu
@999loaderu 2 жыл бұрын
really well explained m8. Appreciate it. thx
@premalupadhyay3555
@premalupadhyay3555 3 жыл бұрын
Great and simple explanation, I like this way of teaching a lot.
@faikyesilyaprak8761
@faikyesilyaprak8761 3 жыл бұрын
That was lit bro!!!! Thanks for crystal clear explanation :))))
@tetsuorulin9009
@tetsuorulin9009 2 жыл бұрын
I love teaching to the problem. Great video and thanks!
@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
@chinemelumj5349
@chinemelumj5349 2 жыл бұрын
Finally understood generics, thank you so much!.
@williamfernandesdorante6068
@williamfernandesdorante6068 3 жыл бұрын
WOW' You're good at teaching code and concepts. Way to go!
@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!
@MrMarkjams
@MrMarkjams 4 жыл бұрын
This is a great video! Could you do one on Interfaces?
@leeamraa
@leeamraa 10 күн бұрын
correction: you should make this function type-bounded as well, like this --> "boolean absEqual(NumericFns
@leslyp.blaise7238
@leslyp.blaise7238 3 жыл бұрын
Explanation clear and concise thank you
@morolillyshean8816
@morolillyshean8816 2 жыл бұрын
Yes, this is the best one I found. Thanks!
@timo_b3
@timo_b3 3 жыл бұрын
Thank you, excellent explanation!
@nikeshparajuli6345
@nikeshparajuli6345 4 жыл бұрын
it's really helpful,thanks a lot .
@lancelotlin3459
@lancelotlin3459 3 жыл бұрын
Best tutorial! Thanks for your explanation!
@kalyanmatamarugu9396
@kalyanmatamarugu9396 3 жыл бұрын
Clean, simple and perfect content!
@chikken007
@chikken007 3 жыл бұрын
Great explanation! Just gained a new Sub. Thank you and keep it up please!
@earl0fBronze
@earl0fBronze 3 жыл бұрын
I read a thirty page chapter on this, one ear out the other. This video is outstanding, mind blown.
@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
@irenaslavova2041
@irenaslavova2041 3 жыл бұрын
Very helpful for me, thanks!
@abidali5131
@abidali5131 3 жыл бұрын
Thank you, I learnt something new today
@lazpz617
@lazpz617 Жыл бұрын
This video really helped me understand Generics way more than my instructors classes
@junveld4830
@junveld4830 4 жыл бұрын
Thank you, very useful! I wish you were have more views ❤️
@bibahbibah5108
@bibahbibah5108 2 жыл бұрын
i like the u develop the subject, uake java very easy to work with
@sjakie0420
@sjakie0420 2 жыл бұрын
Thanks, very clear explanation
@nisarullah7734
@nisarullah7734 3 жыл бұрын
Great work keep it up
@technocoh
@technocoh Жыл бұрын
Amazing, simple explanation, thank you! =D
@thomi100
@thomi100 Жыл бұрын
Very well explained, thanks!
@MrDoctorSchultz
@MrDoctorSchultz 3 жыл бұрын
Smooth, informative, and straight to the point. Keep up the good work!
@tamimjabr1648
@tamimjabr1648 3 жыл бұрын
You are awesome bro, thank you for this video
@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?
@gmailservice9945
@gmailservice9945 2 жыл бұрын
very useful and well explained. thank you
@ravenmadd1343
@ravenmadd1343 3 жыл бұрын
Why can't everything be explained this clearly and quickly? Thanks for doing this and keep up the good work.
@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
@himangshuchowdhary4369
@himangshuchowdhary4369 2 жыл бұрын
Great explanation KOC!
@athardaif863
@athardaif863 3 жыл бұрын
I was struggeling with understanding generics until I watched your video. Thanks a lot :)
@Officially_fit
@Officially_fit 2 жыл бұрын
This guy is just amazing
@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
@beatakazmierczak2543
@beatakazmierczak2543 2 жыл бұрын
Simply explained! Thank you!
@cirodecarlineto2483
@cirodecarlineto2483 3 жыл бұрын
Thnks for the vid sam!!
@fernandaribeiro2231
@fernandaribeiro2231 3 жыл бұрын
oh my God, thank you so much!!! you make this look easier
@arnabmukherjee5840
@arnabmukherjee5840 4 жыл бұрын
Awesome tutorial bro
@buddhikachathuranga2968
@buddhikachathuranga2968 2 жыл бұрын
love the way you teach
@shecodesthings3978
@shecodesthings3978 3 жыл бұрын
Ah, another example of my previous compsci professors failing to teach something fairly straightforward... *facepalm* You, on the other hand, taught it in such a practical and applicable manner: Discuss a simple problem and then propose a solution (and actually working through the example) Super easy to remember too. Great video!
@mimischly2547
@mimischly2547 3 жыл бұрын
thanks man great explanation
@porkfreegaming5278
@porkfreegaming5278 2 жыл бұрын
You are awesome! thank you good sir
@_PrajaktaMokale
@_PrajaktaMokale Жыл бұрын
Thank u🥰😊 awesome video 👍👍
@netrob
@netrob 2 жыл бұрын
Well explained. Thanks!
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Java generics ❓
22:04
Bro Code
Рет қаралды 98 М.
Joven bailarín noquea a ladrón de un golpe #nmas #shorts
00:17
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Рет қаралды 5 МЛН
Did you find it?! 🤔✨✍️ #funnyart
00:11
Artistomg
Рет қаралды 120 МЛН
Java Interface Tutorial
14:49
Keep On Coding
Рет қаралды 128 М.
Object Oriented Programming - The Four Pillars of OOP
11:23
Keep On Coding
Рет қаралды 309 М.
This is how Generics in Java actually work
14:45
Visual Computer Science
Рет қаралды 2,7 М.
TypeScript Generics are EASY once you know this
22:21
ByteGrad
Рет қаралды 120 М.
Java Generics Explained
13:45
Jack Hodkinson
Рет қаралды 45 М.
Clean Code is SLOW But REQUIRED? | Prime Reacts
28:22
ThePrimeTime
Рет қаралды 262 М.
Collection and Generics in Java
14:32
Telusko
Рет қаралды 762 М.
Java Classes & Objects
11:36
Keep On Coding
Рет қаралды 292 М.
Java Generics Tutorial
18:12
Programming with Mosh
Рет қаралды 60 М.