I’ve “known” Generics for many years now but never really understood the difference between usage of wildcard vs a type parameter, even after having read the official docs a gazillion times. But your just one 15-min video has made everything crystal clear. Amazing! Thank You for making the video :)
@kakasy53352 жыл бұрын
as for me, the best explanation was in Bruce Eckel's book "Thinking in Java", everything fell into place after reading this monumental book
@caiocesarmelolopes21562 жыл бұрын
yeah, I like to watch these videos, always has something we don`t know :p
@adipurnomo56832 жыл бұрын
Same here
@sssxxxttt2 жыл бұрын
Thanks, for this comment made me rewatch the end. Lost focus earlier :)
@jaimesastre63932 жыл бұрын
Great explanation. I just have a stupid question for Cat. If you ask to shout(new Cat()) , a class, how is it that it prints 'meaw'? I didn't see clearly the class.
@thirajsenevirathne82592 жыл бұрын
This is the greatest Java tutorial I have ever found on KZbin. Not too lengthy, covered huge concepts within a few minutes. As well as clear and understandable English. Thanks.
@YtubeUserr11 ай бұрын
What are "huge concepts"?
@piotrek76336 ай бұрын
@@YtubeUserrits a bot comment
@JamieCrew4 ай бұрын
@@YtubeUserr Yes, it's illogical to assign magnitude to a non-physical construct such as a concept, but if your comment was not about that and rather why generics are not important then I disagree.
@shivakumarn.r49312 жыл бұрын
My attention span was 5 to 8 minutes before watching this video, now it's 17 minutes. Thanks Jhon!!
@lormalxd40552 жыл бұрын
I just began my Education in Software Developing, one year passed and I've learned so much more from like 5 Videos from John than I've learned in the entire year, that's insane.
@clarkvaughan2 жыл бұрын
Hands down, the best explanation I've ever seen. What a teacher.
@vazzdoin2 жыл бұрын
This tutorial was so simple that I immediately implemented the generics very easily to one of the projects that I'm working on whereas a day ago I was just refraining from doing it just because of not being very confident with the Generics concept. Great stuff John, this was a very informative yet very simple to understand tutorial. Keep up the excellent work.
@Free_time_Games11 ай бұрын
I literally love tutors who not only explain the way to write a code but also follow the technique of clearifying why we use this instead of that which is incredibly useful . Thanks a lot ❤❤
@Jesus_Na_Causa2 жыл бұрын
I'm Brazilian, I learned more in your class with you speaking in English than I normally learn in the classes I attend in Portuguese. Very good teaching. Thank you so much!
@krishnachaitanya12652 жыл бұрын
OMG i never knew i can learn these many things in 17 mins. Man i would love to work under tech leads like you. People like these improve quality of life as well
@Orctupus5 ай бұрын
This deserves an award for being the first perfectly clear guide on generics. I've done many courses and many java certified developer courses that fail to explain exactly how they work. Well done.
@glenn87812 жыл бұрын
At 16:00 I'm sure others might have had this question pop up in their minds as to why can't we just use private static void printList(List myList) instead of using the wildcard '?'. So although we could use the former format i.e. just with T in this case, but there's a difference between '?' and 'T'. 'T' means that your class or method will use classes of ONLY of type T, whatever T is defined to be, wherever a reference to T is made within the class or method, whereas '?' means that the class can be of ANY type. For deeper understanding of this difference, refer to the Generics chapter of the Java complete reference book wherein there's a specific use-case for when using won't work so one would have to use the wildcard '?'.
@rohitsai8062 жыл бұрын
Can you send the link to that book or explain which scenario ... will only "?" work
@glenn87812 жыл бұрын
@@rohitsai806 Yeah sure. So the book is Java The Complete Reference (9th edition) by Herbert Schildt. You can easily get its pdf online as it's one of the most recommended books for Java. The wildcard sub topic is under Generics, chapter 14 in the book. The scenario that I'm talking about is mentioned there more clearly wherein you can only use '? ' and not 'T'
@licosan-z2v2 жыл бұрын
Honestly, this video clearly explains what generics is all about. It took me awhile to understand it but right here, it just takes 17mins of your time. Thanks for putting out great and concise content on Java!
@arbazadam3407 Жыл бұрын
This is by far the best video on generics in the entire universe. Mad respect for this dude 🙏🙏
@嘉然今天吃战斧牛-u1h2 жыл бұрын
I am a junior Java back end developer, your tutorial is so efficient to explain everything clearly, thanks a lot . Recently, I review your video contents in spare time again and again.
@vuongang13082 жыл бұрын
Among tons of courses I have ever seen and learned, I found out that Coding with John is the best. He explains confusing things in such an easy way. Additionally, his voice is so clear and easy to understand, that I can focus only on the code running on the screen, whereas I need to pay attention to reading cc in other courses. You're amazing, John!
@ruimenoita39962 жыл бұрын
What I think it's missing is the generics that use the super word, like List, and explain the difference and the use cases of extends and super.
@sameerkadgaye2048 Жыл бұрын
Yes pls explain wildcard with super keyboard
@TrisnoadiWikantoro Жыл бұрын
@@sameerkadgaye2048slammed my keyword
@thorim98856 ай бұрын
"extends" is called "upper bound", because the given parameter has to extend the given classe. (e.g. T extends Number, if you want to add numbers) "super" is called "lower bound", because the given parameter has to be a "super-class" of the given class. (e.g. you only want bigger mammals like cats, dogs and horses - and not rodents)
@Hughsie282 жыл бұрын
There are just straight up some of the most perfect tutorials for someone like me, even 6 years in the Java industry and now upgrading to newer versions. Thanks John!
@biancaivanciuc84538 ай бұрын
Hi Jhon, I know this tutorial is from 2 years ago, I'm new in this IT field, and I just wanna tank you so much for all your tutoriales, you have no idea how much helped me! Please continue to do this! You are a GREATE techer! Stay safe!
@marcossantos-yr3ee2 жыл бұрын
I know generics for a while. I remember my professor explaining about it and he spent kinda 9 hours, in 3 hours classes to explain what you have done in 15 minutes, unbelievable!!! Shout out to you!!! 👏🏼👏🏼👏🏼👏🏼👏🏼
@NickAndJulia2 жыл бұрын
Great video, thank you for the explanation! Tho I haven't noticed any info about why not to use generics everywhere. Googled a bit and found this: The only case when wildcards is the only option: Wildcards support both upper and lower bounds, type parameters just support upper bounds. So, if you want to define a method that takes a List of type Integer or it's super class, you can do: public void print(List
@ganapathi25312 жыл бұрын
This is my first comment in KZbin after many years , video had so much good content and value, Please Post more videos on generics in real time application , as production ready code that we use for configuring external dependencies Congrats John , Keep up the Good work ❣️
@albiole3 ай бұрын
Best concise explanation of Generics ever filmed.
@moeal51102 жыл бұрын
Another well-done tutorial here! Can't wait to see one on java 8 streams as I have not really found one that goes deep into these concepts.
@jaggadaku35652 күн бұрын
you literally made Java so much easier for us......super job
@Sachin-ev8mj2 жыл бұрын
I was looking for a short playlist/tutorial to understand the generics concept it was a bit confusing for me as you said. But this.. just one video cleared the concept. Thanks a lot! Keep making such videos👍🏻
@marta49332 ай бұрын
I didn't only understand generics with this tutorial, I also enjoyed watching it to the end! Video tutorials longer than 10 minutes often make me feel bored so can't follow them to the end without several pauses, but with John's video tutorials time just flies!
@THECOFFEEPOT2 жыл бұрын
I’ve never known anyone to explain things as easily as you do, fantastic video as always.
@shareknowledge7766Ай бұрын
This is the greatest Java tutorial I have ever found on KZbin. Not too lengthy, covered huge concepts within a few minutes. As well as clear and understandable English. Thanks.😍
@MathematicalCowboy2 жыл бұрын
Sensational lecture! Dude, please become a computer science professor! Your lectures are the best! Thank you so much.
@rickyav4534 Жыл бұрын
The way you explain with coding examples showing how they work.. that too in a simple way is amazing.
@victorezeganya75662 жыл бұрын
Beautiful Tutorial. It’s just amazing how you were able to explain this complex topic very easily. Keep it up John you are adding value to lives. God bless you for the good work you are doing sharing knowledge
@chiranjalitha5596Ай бұрын
Only if our university was this chill to teach something simply like you do. They start with complicated stuff and it gets nowhere in our heads. Thanks for the Tutorials.
@andrewjaeger2 жыл бұрын
*Hey John, can you please make a video on lambda expressions in Java? Would really appreciate!*
@akshaylonkar7132 жыл бұрын
Waiting for Lambda, Functional Interface, Streams
@richardday31362 жыл бұрын
@@akshaylonkar713 l -> ( kzbin.info/www/bejne/mmTCp6CagLh4acU )
@jaykay79322 жыл бұрын
lambda is straight forward. the main function provides the data and you perform the operation within the parenthesis ie someMethod(x -> x.result ? 1 : 0)
@pinolskun87642 жыл бұрын
@@jaykay7932 Your terrible attempt at an explanation gone wrong is precisely why these videos are instead highly appreciated. Leave the explaining tho who knows how to do it
@Hughsie282 жыл бұрын
I don't think I can keep up at Johns level as Pinols says, I'm also beginner/struggling with lambdas a bit, but from what I have learnt is anything after the "->" or in the "{ }" after the arrow is like the contents of a function method, any variable before the "->" is the current item you are iterating through. (It kind of reminds me of Java callbacks in a way) hope this example syntax below might be useful, I'll use streams as an example it seems a great way to use lambdas // Without curly braces (1 liners) List numbers = new ArrayList(1,2,3); numbers.stream().forEach(number -> System.out::println); // With curly braces (multi-liners) List names = new ArrayList("Dave", "John", "Andrew"); names.stream().map(name -> { if (name.equals("Andrew")) { return true; } return false; }).collect(Collectors.toList());
@ayanSaha13291 Жыл бұрын
I have been using Java for more than 10 years now and have to admit that I hadn't understood generics so elegantly before. Thanks a lot for the video.
@wwefan93912 жыл бұрын
Great Video, but I'm confused on one thing, at 15:11 when you created the printList method , the Arguement was List myList and you said this is a list that will hold any type of object, but if you wanted the list to hold any type of object why didn't you just write List myList? Isn't that why one would use generics for like you explained in the video?
@sunshine5106Ай бұрын
Very Helpful! Clear concise and complete explanation. If someone is finding it a little fast please slowdown the playback speed and watch the video, it's really good.
@juliopocielan79702 жыл бұрын
I never understand the right way of generics, I always have a kind of confusion about that, so here comes a 15-min video that clear everything. Just an amazing work! Thank you for make this video!
@nathanhalash33682 жыл бұрын
Your videos are clutch. Your a life saver. My professor makes up a whole bunch of super complex examples when attempting to explain these topics to the class but just ends up confusing us due to the complexity of what his code is trying to do.
@DigitalAstronautOG2 жыл бұрын
You have quickly become my favorite Java tutorial KZbinr! Thank you for demystifying confusing Java concepts! :)
@Knowyourelectronix2 жыл бұрын
This man is just awesome.....I wish I have a teacher like this person in my previous semester ... And I got to know him now finally god hears my prayers... don't stop these tutorials man.....these are life for people like us
@manojr52572 жыл бұрын
Hey John, thank for the tut! You made generics so simple to understand. Would love to see tuts on followings; Method referencing, Lambda Functions Optionals Stream API Thanks again.
@flex_prods2 жыл бұрын
Totally, Lambda is really confusing
@TheShlips2 жыл бұрын
@@flex_prods no it isnt
@Shivam8Pandey2 жыл бұрын
That's the most simplest part of java 8 😃
@umangsharma74472 жыл бұрын
I am literally afraid of generics in java. Could never understand what are T, V & ? . But your video made me understand the basics so clear. Thank you so much !!
@bubut1232 жыл бұрын
This video reminds me the quote “If you can't explain it to a six year old, you don't understand it yourself”
@marwamohammed7002 Жыл бұрын
I’m working with c# and no nothing about Java but now I think I’m going to learn from this channel about both Java and c# . Thank you so much
@master47552 жыл бұрын
So in your code you have : private static void PrintList (List myList) {} Couldn't you also do ??: private static void PrintList (List myList) {} They appear as though they work the same, so what's the difference, surely one is better than the other (or more dangerous to use if the compiler doesn't treat it the way we want) ?
@mohammadazizi37353 ай бұрын
I love how you ask yourself why we should use this and explaining very clear
@josephjackson70858 ай бұрын
I wish my intermediate Java programming class was just your videos imbedded with the labs and questions I would fly through it. Thank you
@ruhandanielkremes3898 Жыл бұрын
Man, you changed my life with this video, i was having a lot of problems trying to unsdertand how(the first thing of my subject works) generics works and I hasn't found anywhere in my mother tongue, i was thinking that i wouldn't be able to understand how does that work until I found you! The explanation made me think by other perspective and made me confourtable to understand how does all of this works( even missing somethings like what does have on animal or how does exactly the try catch trow and trhows works) and now i'm ready to understand a lot more thigs of my classes. THANK YOU!!!!! SO MUCH!!!!!!!!! You are crazy man!
@isurugayashan4573 Жыл бұрын
The explanation was quite exceptional. i am a java engineer for 5 years and now only i got to know the full context of the generics.. thanks and keep feeding..
@faraskhan39402 жыл бұрын
I have learned two thins today that had plagued me for years ! 1. The and 2 the reason that the list is not subclass of list
@flexerfadrigalan Жыл бұрын
Fantastic video. The "why" in the beginning is what really solidified my understanding as to why we need generics. I know how to use generics, but now I understand why we really need them! Thank you!
@vikasreddy6970 Жыл бұрын
You Deserve Noble prize for crystal clear explanation which I don't understand over the years ......tq .
@JB-gv7pt Жыл бұрын
I'M SITTING HERE STRESSING TRYING TO UNDERSTAND WALLS OF TEXT FROM CANVAS AND YOU COME ALONG AND HAVE ME FEELING LIKE A PRO IN 17 MINUTES. I WANT YOU TO SIT HERE FOR A SECOND AND TRULY TAKE IN HOW MUCH TIME AND EFFORT YOU'VE SAVED ME AND THEN MULTIPLY IT TO THE HUNDREDS OF THOUSANDS OF PEOPLE THAT HAVE WATCHED THIS. SERIOUSLY TAKE IN THE IMPACT THAT YOU'VE HAD AND PAT YOURSELF ON THE BACK. YOU DESERVE IT. THANK YOU JOHN!
@040409532 жыл бұрын
This is the actually the best explanation o generic types ever, not only for Java but the concept as a whole!
@craftyrouze2 жыл бұрын
Thanks for clarifying the usage of each. I was mostly confused about ?, but it now makes sense that its used with collections rather than individual objects.
@xeanluxcrille68472 жыл бұрын
I actually studied this extensively so many years ago and ended up implementing it for the DAOs used by the ORM in one of the projects I was assigned in in my previous company. To this day, I hear they are still using it as some sort of framework code for DAOs used by ORMs in that company even when I'm no longer around there. Watching this video reinforces the things I have learned and made me more confident that the things I learned when I studied it alone were correct. Kinda makes me feel that although it was an overextension of effort, it wasn't in vain.
@jm56481 Жыл бұрын
I've been a SDE for a couple years and found myself using generics forever without actually knowing what was going on. Thanks for the background and clear explanation!!
@PaulOlsztyn-m2r6 ай бұрын
John, you are just a gifted teacher. Thank you so much for these videos. I've reached the age that I can never remember all the Java stuff I've learned, and I know I can get a quick refresher that will have me back up to speed by watching one of your videos. Or if I need to learn a new topic, I can just watch one of your videos and in a short time I'll be up to speed. Thank you so much.
@theophilus4942 жыл бұрын
i learnt everthing on generic in 17 minutes.... thank you John.. great video content..
@favour405 Жыл бұрын
You really know how to teach and get knowledge across. Some people are knowledgeable but don't know how to teach. I learn a lot from your videos. Thanks a lot.
@VictorBombella Жыл бұрын
What'd be the difference between: "private static void printList(List myList)" and "private static void printList(List myList)"??
@lenfy.5 ай бұрын
I am a beginner in Java and even though I don't know that much about Java I could easily understand most of the things in the video. I'm so happy that I came across your channel. Looks like this channel will help me a lot :D
@MicheleSantagiulianaMCPАй бұрын
I finally understand Generics. Fourth time i go through this topic. THANKS!!!!!!
@oswaldovirto58962 жыл бұрын
Hey man, I just want to say thank you. I've been struggling with this topic for a while now and now I feel a lot more comfortable working with generics after watching this video. You're the best!
@dannggg2 жыл бұрын
This is the best video on generics. And I’ve seen nearly all videos on generics on KZbin.
@petebrown6356 Жыл бұрын
I did mountains of Java from mid-90's to 2010-ish, then focused on an architect role. I recently had to understand a new Java framework and it uses all these new Java features - I was having a hard time scanning through the code. THANK YOU for the clear and concise explanation.
@otter5022 жыл бұрын
This makes me cook so much more simpler and it also gives context to how arrays are initialized
@umabharathyts19985 ай бұрын
I never understood this topic for years , I am having my interview tmrw this helped me a lot to understand it quickly.KEEP DOING THE GOOD WORK MAN !!!!❤
@leeamraa Жыл бұрын
good job and thanks. one comment though: instead of the function "printList(ArrayList lst)" we can use " void printList(ArrayList lst)" and it works.
@exrocker47 Жыл бұрын
Gosh I have been wasting my life trying to understand this concept on Kotlin. Now everything is crystal clear. Amazing video!
@blazekiller5212 жыл бұрын
Thank You So Much.... Finally Even After 2 Years Of Professional Experience Got To Know Generics Clearly.... Thanks A Lot....
@lx63812 жыл бұрын
dude you are the best java teacher on youtube. thank you
@AlexandreGTavares Жыл бұрын
What's the difference between: private static void printList(List myList) and private static void printList(List myList)
@seatconnect224 Жыл бұрын
best java generic video I've eve seen
@maziarchoubineh7787 Жыл бұрын
First and foremost, I would like to thank you for your excellent teaching. I have been learning this topic for months, and now I have fully understood it. I would recommend providing the code used in the lessons as a zip file.
@ahmedbishree94292 жыл бұрын
I'm watching this video every time that I come across generic types in my work, Man, you are a great toter thanks a lot...
@dhaw2 жыл бұрын
Hands down the best explanation of java generics .
@Duedme2 жыл бұрын
Now I finally understood, thank you Dean Pelton
@jasonelish893510 ай бұрын
Great crash course on Java generics. Each time during the video I was like "What about this situation", you covered it shortly after, which was great. Thanks.
@martinsanchez-hw4fi9 ай бұрын
This might be the best explanation ever. Every video I have watched of you is totally amazing. The flow you get from one idea to the next is next level. Thank you
@aja9388 Жыл бұрын
Thank you so much for making your videos. I have problems with concentration of attention and memory, and it is difficult for me to listen, watch and read something for more than an hour. I am now in my first year at university and your videos help me so much to understand the material better and remember it for a long time.
@sachinkadam56342 жыл бұрын
Honestly I have learn many things about generics in this small video. Thank you John for such a nice explanation and hands on demo on generics.
@user-ds6wu4si9e3 ай бұрын
Simple to understand and straight to the point. Thank you so much. Now I have another tool in my arsenal!
@deepanshupanwar501 Жыл бұрын
I went through a 3 hour lecture on OOPs and after that went through a couple of KZbin videos but I was not able to fully understand what exactly generics were and why are they used. Then I came across this 17 minute video which cleared all my doubts and made everything super super simple. The difference a teacher makes is unbelievable. Subscribing and watching other videos too. Thank you so much!
@cheiguerabdelwehab68022 жыл бұрын
I used to hate java, till i discovered this chanel, thanks a lot
@maxfan60352 жыл бұрын
I failed an interview. One question is about Java generic which was introduced in 1.5. I never wanted to review it with details since I thought I knew it when I used the similar feature in C++ years back. It turns out I needed to. This video really helps in a sense covering pretty much every corner of this feature in an easy to understand way.
@chinmayrath84942 жыл бұрын
One doubt: when you spoke about wildcards, you gave the example of passing a List of any class to a method. Instead of using wild card, we could've used this way right?: private static void printList(List myList) This works perfectly fine as well, then why do we need wildcards ?? 🤔
@kajalkoravi79602 ай бұрын
I have the same doubt. anyone could explain, please?
@tylerhinkle28732 жыл бұрын
I swear, without you and your videos I would not be passing my Advanced Java class this semester. Thank you so much!!!
@ahmadrasheed2598 Жыл бұрын
Wow no words. Hands down the best Explanation of Generics🥰
@kingstonejob78402 жыл бұрын
Wow! fast but best explanation ever, good job.
@Nallu_Swami Жыл бұрын
Thank you so much. Your Channel is the best Java programming channel that I have encountered while learning Java as a Freshmen in my College.
@Nallu_Swami Жыл бұрын
And not to mention the tutorial was so good i understood this in the first 5 minutes
@kfirlozer2 жыл бұрын
This is no longer super confusing, best tutorial I've seen on the subject, thank you John!
@BeyondNoise92 жыл бұрын
What is the difference between List and List ?
@wlk73182 жыл бұрын
This could possibly be the best explanatory video I have ever seen. Thank you.
@christiandopico80822 жыл бұрын
Love the explanations when you show the problem that this concept solves. It makes it more clear to understand !!
@max_73442 жыл бұрын
Putting your camera right upper top is brilliant yet reliable, dunno why but it makes more easily understandable
@CodingWithJohn2 жыл бұрын
Yeah I'm not sure why I like it more, but I definitely do
@metaocloudstudio22212 жыл бұрын
I've been working with Java for 16 years but I still watch your videos since they are satisfying
@MyThoughts19902X2 жыл бұрын
Kudos for explaining a confusing topic in a very understandable manner. Just like to add we also have lower bounded wildcards
@xinyiphang28609 ай бұрын
This man taught me generics and wildcards better than my professors ever did. Thank you. You saved me :')
@andyzhong11442 жыл бұрын
fantastic teaching on youtube for free for all! thank you, this is amazing! 17min solved my confusion i had for WEEKS!