Generics and Wildcards in Java | Part 1 | Generics with Wildcards in Java Made Simple | Geekific

  Рет қаралды 37,905

Geekific

Geekific

Күн бұрын

Пікірлер: 36
@ZenjobBuddyJensJeremies
@ZenjobBuddyJensJeremies 2 жыл бұрын
Thank you so much for this. The first good explanation of wildcards I have seen so far!
@kalebnegussie8140
@kalebnegussie8140 2 жыл бұрын
Well done. I had a question and you answered it 100%. Awesome video. Thanks.
@geekific
@geekific 2 жыл бұрын
Glad I did! Happy to help :)
@DivinityAgarioMore
@DivinityAgarioMore 3 жыл бұрын
You are very good at explaining. For the future, maybe you can look at providing realtime problems and solutions to deepen our understanding further. Other than that, excellent video!
@geekific
@geekific 3 жыл бұрын
Thanks a lot, happy you liked it! And great suggestion will keep it in mind for the future :)
@pavolalmasi3760
@pavolalmasi3760 2 жыл бұрын
I am so happy that I've found your channel, your videos are super informative and everything is very well explained, keep it up
@geekific
@geekific 2 жыл бұрын
Thank you! Glad I could help :)
@ucanhtran4372
@ucanhtran4372 Жыл бұрын
GREAT EXPLANATION !!!!
@notsoholyspirit9312
@notsoholyspirit9312 2 жыл бұрын
Extremely helpful video !!
@geekific
@geekific 2 жыл бұрын
Glad you think so!
@manux7739
@manux7739 10 ай бұрын
thanks for the explanation!
@innerpeace5877
@innerpeace5877 Жыл бұрын
you are the best your video saved me ily
@alvaro1379
@alvaro1379 Жыл бұрын
wow this was so well explained thanks for the video!!
@pedromedeiros8025
@pedromedeiros8025 3 жыл бұрын
It was very helpful. Great job!
@geekific
@geekific 3 жыл бұрын
Glad! Thank you!
@markconnolly5260
@markconnolly5260 Жыл бұрын
Great videos. Live them ❤
@louzexuzhou
@louzexuzhou 3 жыл бұрын
This is gold.
@geekific
@geekific 3 жыл бұрын
Thanks a lot! Your words are gold to me :)
@bluem03
@bluem03 Жыл бұрын
Why shouldnt i always use Wilcards? and just bound to a specific Type
@bjugdbjk
@bjugdbjk 3 жыл бұрын
Great and Simple to the point !! One question though, u mean Generics are class wise and wildcards are for Method wise boundaries ? is there any other difference further ..
@geekific
@geekific 3 жыл бұрын
Generics can actually be used for methods as well as for classes, when we do so the method is called a generic method, so the type parameter will be tied to the method alone and not the class. However, making use of the wildcard at class level won't really make sense, your code won't compile. Wildcards are used in Java to handle variance, and you can't create a class if you don't know what attributes it defines! We will be covering all these in a part 2 Generics video, stay tuned! Hope this answers your question :) Cheers!
@coop6734
@coop6734 2 жыл бұрын
Thank you!
@esoterikouno
@esoterikouno 2 жыл бұрын
thx, now I understand.
@geekific
@geekific 2 жыл бұрын
Glad I could help! :)
@kakashi99908
@kakashi99908 2 жыл бұрын
Hello I am remaking data structures to better understand how to use them. Can you explain wild cards used in the class level like this: public class MaxPriorityQueue
@geekific
@geekific 2 жыл бұрын
Hello, we will be uploading a video Part 2 that dives in the details of generics and should answer all of your questions regarding this topic! Stay Tuned!
@ionguzun3952
@ionguzun3952 Жыл бұрын
nice video
@lucasf.v.n.4197
@lucasf.v.n.4197 3 жыл бұрын
No ? super T explanation thumbs down
@geekific
@geekific 3 жыл бұрын
Thanks for the review! However, am not sure what seems to be the problem or which parts of the video weren't clear, can you elaborate so we can fix it?
@lucasf.v.n.4197
@lucasf.v.n.4197 3 жыл бұрын
@@geekific u only explained
@geekific
@geekific 3 жыл бұрын
You are right :) We'll be working on a part 2 generics video to expand further on the subject! Stay Tuned! And meanwhile, as a quick answer to your question: 'extends' means that the generic type (?) has to be a subclass of T, however, 'super' means that the generics type has to be a super class of T, in other terms it is T that extends the generic type (T represents the lower bound here). Hope this helps. Cheers!
@lucasf.v.n.4197
@lucasf.v.n.4197 3 жыл бұрын
@@geekific Got it; but when should I be using which? And why in the documentation there are methods that use super? For example, the Stream interface has the method forEach, that takes a "Consumer
@geekific
@geekific 3 жыл бұрын
Okay, the fully detailed answer will have to wait for the video, but in short remember PECS (Producer extends, Consumer super). When you are producing or "reading" use extends, when you are consuming or "writing" go for super and if you need both do not use a wildcard just T. They make your code more flexible by allowing the use of subtypes and supertypes when needed. Stay tunned for more details in an upcoming video!
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
#behindthescenes @CrissaJackson
0:11
Happy Kelli
Рет қаралды 27 МЛН
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 907 М.
Generics in Java - Full Tutorial
20:08
Daily Code Buffer
Рет қаралды 29 М.
Java generics ❓
22:04
Bro Code
Рет қаралды 121 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 163 М.
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 225 М.
Learn Java GENERICS in 13 minutes! 📦
13:56
Bro Code
Рет қаралды 2,7 М.
What are Wildcards in Generics | How it Works | Java
8:58
CoedMaster
Рет қаралды 899
Java Generics Tutorial
12:23
Keep On Coding
Рет қаралды 185 М.
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН