How can i create and use Generic in C# 4.0?

I need a manual or tutorial with examples of how to  use Generic and when to use them.

I am studying Thread right now and I need to know how Generics come into place.

Also, I need to have a clear picture of when to use them and when not.

Thank you for your help.
Who is Participating?
AndyAinscowConnect With a Mentor Freelance programmer / ConsultantCommented:
Generics and threads are two different things, don't confuse them.

A thread will allow you to for example perform a long calculation AND have the main window still respond to the user.

A generic will allow you to have one function that can work with many different types of objects.
nmarunConnect With a Mentor Commented:
As Andy said, they are two different things.

I'm sure you're reading your previous question about threads:

Just keep that on a different 'compartment' and then read this about Generics:

iscivanomarAuthor Commented:
Thank you AndyAinscow for you short but precise answer.

Yes in deed, I read the other question and created some little programs to get the idea and get use to write threads. also, thank you for the manual an Generic.

Have a good day both.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.