Java Generics Tutorial - 053

preview_player
Показать описание
At some point you've likely heard about Java generics. Generics were introduced into the Java language in Java 5. In the next few videos, we're going to take a deep dive into what generics are, how to use them, and ultimately how to create our own Java generics.

A generic is a class that acts like a template for creating classes. In this case, we define how the list works without stating what classes the list holds. We'll have add and remove methods, but we won't say what class we're adding and removing until we define the instance. Once we instantiate our class, we'll tell it the type our list works with. No other type is allowed. Using a generic class gives us type safety.

#java #programming #tutorial #generics







Concepts: Java generics, Java

Social Links: Don't hesitate to contact me if you have any further questions.

Related Videos:

Media credits: All images are owned by DJ Spiess or used under CC0 unless listed below

Рекомендации по теме
Комментарии
Автор

Why did you stop posting? I really like your explanations :) sadly I came across your channel just a few days ago. I've seen almost every video and your content is great (Y)

theresydipaolo
Автор

I am sad you stopped posting. These videos are great!

JoseGarcia-bnkq
Автор

We need more videos like this. Keep going. Thank you #DeegeU

maance
Автор

You're back! Your videos helped me a lot with Java. You make everything so much easier to understand!

Chaseosa
Автор

Thanks, I don't really understand how to create my own generic types myself but I'm still learning. This video helped me a lot.

JorgeEscobarMX
Автор

Hey, just wanted to say, Thank you for all the videos. It's sad that you stopped posting though.

iparadoxg
Автор

Well done man! Like your focused java tuts. Plz dont stop ;)

xmo
Автор

please make more videos on Java
future topics

pratikgupta
Автор

Nice one! I would really appreciate a follow-up video that goes a little more in-depth, especially with the special features such as bounded types, instanciation and usage of wild cards

Keep up the good work!

bhthllj
Автор

I saw this in another video: "list = new arraylist(); " can you explain why the left side is list while the right side is arraylist?

Stichting_NoFa-p
Автор

really awesome, and thank you very much and eagerly waiting for your next video

premraj.m
Автор

Generics are possibly one of my favorite things.

CJBurkey
Автор

nice video ! i was thinking the same about array lists ._. cant wait for next video to create my own array list :P

Nikandlv
Автор

You have a couple of MyClass[] array= new MyClassList(), like InvItem[] array=new InvLinkedList(). This is not valid, please correct.

cornelnicola
Автор

I like this because I speak English and the presenter is a native English speaker. So many programming videos are by non-native English speakers who speak it quite poorly.

ksevksev
Автор

very nice video but as we have currently java 8(soon 9) it would be nice to have something about latest features like functional programming, etc.

TheWoyg
Автор

Where are you? Dont make me go to your linkedIn to tell you to come back!

jereramirez
Автор

is to ok if i am learning java when im 10?

solt
Автор

ArrayList<Sprite> SpriteList = new ArrayList();
SpriteList.add("Hello World");

My java knows there's an error at compile time

frankye
Автор

strange..java tutorial not done by indian

_slier