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

preview_player
Показать описание

In this video we cover Java Generics and Wildcards. Additionally, we answer why and when you should make use of them while developing an application or writing any piece of code.

Timestamps:
00:00 Introduction
00:25 What are Generics?
02:29 Implementing Generics in Java
03:38 What are Wildcards?
05:07 Bounded Generics and Wildcards
07:27 Why can't primitive types be used with Generics?
08:08 Recap
08:27 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #Generics #Wildcards #Java
Рекомендации по теме
Комментарии
Автор

Thank you so much for this. The first good explanation of wildcards I have seen so far!

ZenjobBuddyJensJeremies
Автор

Why shouldnt i always use Wilcards? and just bound to a specific Type

bluem
Автор

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!

DivinityAgarioMore
Автор

wow this was so well explained thanks for the video!!

alvaro
Автор

I am so happy that I've found your channel, your videos are super informative and everything is very well explained, keep it up

pavolalmasi
Автор

Well done. I had a question and you answered it 100%. Awesome video. Thanks.

kalebnegussie
Автор

you are the best your video saved me ily

innerpeace
Автор

You are so good, finally I understood wildcards

Ihavetoreturnsomevideotapes
Автор

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 ..

bjugdbjk
Автор

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 <T extends Comparable<? super T>>

I think he helps to think of this line almost like a if statement, If T does not extend Comparable throw exception. Now I am already a bit confused. Don't you need to implement an interface not only exclusively extend one?

Now this is where I am more confused: <? super T>. I am assuming either ? or T is directly referencing the comparable class I really don't understand that syntax...
I guess for some reason "? = some class that implements comparable". Thus this code means If T extends Comparable OR Comparable is implemented by some Superclass of T.

kakashi