Generics in Java tutorial # 5 – Wildcards and subtyping in Generics | Java tutorials by Java9s

///Generics in Java tutorial # 5 – Wildcards and subtyping in Generics | Java tutorials by Java9s

Generics in Java tutorial # 5 – Wildcards and subtyping in Generics | Java tutorials by Java9s

FavoriteLoadingAdd to favorites

Generics in Java Tutorial – Wildcards and Subtyping has been explained with good examples. I have given an example on why do we need Wildcards and then described about
Unbounded Wildcards, Upper Bounded Wildcards and Lower Bounded Wildcards. I have also explained how wildcards help in subtyping concept in Generics. The Examples used in the
Generics module is now available on Github from the links given below.

Java468x60

Generics Example on Github for download:

Complete Generics Tutorials playlist

Complete Java Beginners Tutorials:

Multithreading in Java tutorial:

Spring 3 MVC Framework tutorials:

Spring Framework Tutorials:

source

By |2019-04-13T17:30:14+00:00April 13th, 2019|Java Video Tutorials|19 Comments

19 Comments

  1. yewei li April 13, 2019 at 5:30 pm - Reply

    Thank you very much, your turorial is helpful to me

  2. Danish ALI April 13, 2019 at 5:30 pm - Reply

    Beautiful, Really Can't thank you enough!

  3. joseph lake April 13, 2019 at 5:30 pm - Reply

    why can't you make type parameters in the method itself seemed to work fine for me it's just more annoying to call the method as you have to specify which class every time you call the method in order to use it properly.
    public static <T extends Object> void mix(ArrayList<T> a)

    but, that method is hard coded unless it's an object method then do
    public void mix(ArrayList<T> a) and it grabs it from the class itself

    Your Saying to do it like so which is better but still could be done either way
    public static void mix(ArrayList<? extends Object> a)

  4. Pritpal Singh April 13, 2019 at 5:30 pm - Reply

    I went through full generic series and i am very thankful to you for getting the concept crisp and clear.

  5. Saimanohar Boidapu April 13, 2019 at 5:30 pm - Reply

    Thank you sir.

  6. Varun Shrivastava April 13, 2019 at 5:30 pm - Reply

    Very well explained

  7. Ming Yan April 13, 2019 at 5:30 pm - Reply

    This series is really helpful to understand how generics works and you will have a better understanding of the upper bound and lower bound of generic data type.
    Recommended for anyone who wants to learn this concept clearly.

  8. Niyongabo Eric April 13, 2019 at 5:30 pm - Reply

    hi man ur video are understandable and well prepared

  9. sreekanth vaddi April 13, 2019 at 5:30 pm - Reply

    nice

  10. Milan Conhye April 13, 2019 at 5:30 pm - Reply

    Very Imformative video. Well done. One of my faviourite YouTubers for Tutorials is Dereak Banas and hes really good, but you are on his level of explanation, your very under rated.

  11. believe theUnbelievable April 13, 2019 at 5:30 pm - Reply

    what is the differenes of list< T > with list< ? > ?

  12. Sayan Pal April 13, 2019 at 5:30 pm - Reply

    nice tutorial

  13. ArmasReverence April 13, 2019 at 5:30 pm - Reply

    Very very good man, I have been having trouble with generics for a while, and now I understand!

  14. Uday Kumar Potnuru April 13, 2019 at 5:30 pm - Reply

    Great video Srinivas on the Generics & you have explained so nicely . However, the example used (introduction part) to explain "why we need wildcards?", somehow i was not convinced .

    class Tray {

    public void add(Glass<?> liquid) { …. }

    }

    can be achieved using Method type parameters like

    public class Tray {

    public <T> void add(Glass<T> liquid) {

    ……………………….

    }

    }

    It would be really great if you can please explain me with example, where exactly we would require wildcards ?

  15. Tirupathi Ch April 13, 2019 at 5:30 pm - Reply

    Thank you Srinivas really I like it. I have been trying to understand generics, so searing on web finally found your videos on youtube helps me to understand clearly about generics

  16. Pankaj Upreti April 13, 2019 at 5:30 pm - Reply

    Nicely explained . Can you xplain Concurrency as well. Hope u ll do that also ina great fashion

  17. Mukesh Patel April 13, 2019 at 5:30 pm - Reply

    best video ever you tart me this in matter of min something our lecture could not do. they just ended up making thing complected then it needed to be. thank you very much!

  18. Mc Paintcraft April 13, 2019 at 5:30 pm - Reply

    What a great video, however, I did notice an error in one of your slides sir. At 17:22, Juice is declared as a class, yet is implemented by the OrangeJuice class?

  19. Madhamanchi Anjaneyulu April 13, 2019 at 5:30 pm - Reply

    Srinivas thanks a lot for your time ..Commendable effort ..Please add if anything left on this topic ..

Leave A Comment

*